0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-------+-+-------------+-------------------------------+ |F|R|R|R| opcode|M| Payload len | Extended payload length | |I|S|S|S| (4) |A| (7) | (16/64) | |N|V|V|V| |S| | (if payload len==126/127) | | |1|2|3| |K| | | +-+-+-+-+-------+-+-------------+ - - - - - - - - - - - - - - - + | Extended payload length continued, if payload len == 127 | + - - - - - - - - - - - - - - - +-------------------------------+ | |Masking-key, if MASK set to 1 | +-------------------------------+-------------------------------+ | Masking-key (continued) | Payload Data | +-------------------------------- - - - - - - - - - - - - - - - + : Payload Data continued ... : + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + | Payload Data continued ... | +---------------------------------------------------------------+
| Modifier and Type | Field and Description |
|---|---|
| public static final int | MAX_HEADER_LENGTH
The overhead (maximum) for a framing header. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | generateHeader(Frame
the frame to generate. frame, ByteBuffer the buffer to output the generated frame to. buffer)Generate the header bytes of a frame into a single ByteBuffer. |
| public void | generatePayload(Frame
the frame to generate. frame, ByteBuffer the buffer to output the generated frame to. buffer)Generate the payload of a frame into a single ByteBuffer, if the frame has a mask the payload will be masked as it is copied to the output buffer. |
| public void | generateWholeFrame(Frame
the frame to generate. frame, ByteBuffer the buffer to output the generated frame to. buffer)Generate the whole frame (header + payload copy) into a single ByteBuffer. |
| private void |
| MAX_HEADER_LENGTH | back to summary |
|---|---|
| public static final int MAX_HEADER_LENGTH The overhead (maximum) for a framing header. Assuming a maximum sized payload with masking key. | |
| Generator | back to summary |
|---|---|
| public Generator() | |
| generateHeader | back to summary |
|---|---|
| public void generateHeader(Frame frame, ByteBuffer buffer) Generate the header bytes of a frame into a single ByteBuffer.
| |
| generatePayload | back to summary |
|---|---|
| public void generatePayload(Frame frame, ByteBuffer buffer) Generate the payload of a frame into a single ByteBuffer, if the frame has a mask the payload will be masked as it is copied to the output buffer.
| |
| generateWholeFrame | back to summary |
|---|---|
| public void generateWholeFrame(Frame frame, ByteBuffer buffer) Generate the whole frame (header + payload copy) into a single ByteBuffer.
| |
| maskPayload | back to summary |
|---|---|
| private void maskPayload(ByteBuffer buffer, Frame frame) | |