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 | Class and Description |
|---|---|
| public static class | |
| private static class | Frame.
Immutable, Read-only, Frame implementation. |
| Modifier and Type | Field and Description |
|---|---|
| protected byte | finRsvOp
Combined FIN + RSV1 + RSV2 + RSV3 + OpCode byte. |
| protected byte[] | |
| public static final int | MAX_CONTROL_PAYLOAD
Maximum size of Control frame, per RFC 6455 |
| protected ByteBuffer | payload
The payload data. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | |
| public | |
| protected | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Frame | |
| public static Frame | |
| protected void | |
| public static Frame | |
| public void | |
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. Indicates whether some other object is "equal to" this one. |
| public byte[] | |
| public byte | |
| public ByteBuffer | |
| public String | Returns: the payload as a UTF-8 string.Get the payload of the frame as a UTF-8 string. |
| public int | |
| public int | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public void | |
| public Frame | |
| public Frame | |
| protected Frame | |
| public Frame | |
| public Frame | |
| public Frame | |
| public Frame | |
| public Frame | |
| public Frame | |
| public String |
| finRsvOp | back to summary |
|---|---|
| protected byte finRsvOp Combined FIN + RSV1 + RSV2 + RSV3 + OpCode byte. 1000_0000 (0x80) = fin 0100_0000 (0x40) = rsv1 0010_0000 (0x20) = rsv2 0001_0000 (0x10) = rsv3 0000_1111 (0x0F) = opcode | |
| mask | back to summary |
|---|---|
| protected byte[] mask | |
| MAX_CONTROL_PAYLOAD | back to summary |
|---|---|
| public static final int MAX_CONTROL_PAYLOAD Maximum size of Control frame, per RFC 6455 | |
| payload | back to summary |
|---|---|
| protected ByteBuffer payload The payload data. It is assumed to always be in FLUSH mode (ready to read) in this object. | |
| Frame | back to summary |
|---|---|
| public Frame(byte opcode) Construct form opcode
| |
| Frame | back to summary |
|---|---|
| public Frame(byte opCode, ByteBuffer payload) | |
| Frame | back to summary |
|---|---|
| public Frame(byte opCode, String payload) | |
| Frame | back to summary |
|---|---|
| public Frame(byte opCode, boolean fin, ByteBuffer payload) | |
| Frame | back to summary |
|---|---|
| public Frame(byte opCode, boolean fin, String payload) | |
| Frame | back to summary |
|---|---|
| protected Frame() | |
| Frame | back to summary |
|---|---|
| public Frame(byte finRsvOp, byte[] mask, ByteBuffer payload) | |
| asReadOnly | back to summary |
|---|---|
| public Frame asReadOnly() | |
| copy | back to summary |
|---|---|
| public static Frame copy(Frame original) | |
| copyHeaders | back to summary |
|---|---|
| protected void copyHeaders(Frame frame) | |
| copyWithoutPayload | back to summary |
|---|---|
| public static Frame copyWithoutPayload(Frame original) | |
| demask | back to summary |
|---|---|
| public void demask() | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getMask | back to summary |
|---|---|
| public byte[] getMask() | |
| getOpCode | back to summary |
|---|---|
| public byte getOpCode() | |
| getPayload | back to summary |
|---|---|
| public ByteBuffer getPayload() Get the payload ByteBuffer. | |
| getPayloadAsUTF8 | back to summary |
|---|---|
| public String getPayloadAsUTF8() Get the payload of the frame as a UTF-8 string. Should only be used in testing, does not validate the UTF-8 and a non fin frame can contain partial UTF-8 characters.
| |
| getPayloadLength | back to summary |
|---|---|
| public int getPayloadLength() | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| hasPayload | back to summary |
|---|---|
| public boolean hasPayload() | |
| hasRsv | back to summary |
|---|---|
| public boolean hasRsv() | |
| isControlFrame | back to summary |
|---|---|
| public boolean isControlFrame() | |
| isDataFrame | back to summary |
|---|---|
| public boolean isDataFrame() | |
| isFin | back to summary |
|---|---|
| public boolean isFin() | |
| isMasked | back to summary |
|---|---|
| public boolean isMasked() | |
| isRsv1 | back to summary |
|---|---|
| public boolean isRsv1() | |
| isRsv2 | back to summary |
|---|---|
| public boolean isRsv2() | |
| isRsv3 | back to summary |
|---|---|
| public boolean isRsv3() | |
| reset | back to summary |
|---|---|
| public void reset() | |
| setFin | back to summary |
|---|---|
| public Frame setFin(boolean fin) | |
| setMask | back to summary |
|---|---|
| public Frame setMask(byte[] maskingKey) | |
| setOpCode | back to summary |
|---|---|
| protected Frame setOpCode(byte op) | |
| setPayload | back to summary |
|---|---|
| public Frame setPayload(ByteBuffer buf) Set the data payload. The provided buffer will be used as is, no copying of bytes performed. The provided buffer should be flipped and ready to READ from.
| |
| setPayload | back to summary |
|---|---|
| public Frame setPayload(String str) | |
| setPayload | back to summary |
|---|---|
| public Frame setPayload(byte[] buf) | |
| setRsv1 | back to summary |
|---|---|
| public Frame setRsv1(boolean rsv1) | |
| setRsv2 | back to summary |
|---|---|
| public Frame setRsv2(boolean rsv2) | |
| setRsv3 | back to summary |
|---|---|
| public Frame setRsv3(boolean rsv3) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final CloseStatus | |
| pack-priv final Runnable |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements java. Closes this stream and releases any system resources associated with it. |
| public CloseStatus | |
| public boolean | |
| public String | toString()
Overrides org. Returns a string representation of the object. |
| closeStatus | back to summary |
|---|---|
| pack-priv final CloseStatus closeStatus | |
| releaser | back to summary |
|---|---|
| pack-priv final Runnable releaser | |
| Parsed | back to summary |
|---|---|
| public Parsed(byte firstByte, byte[] mask, ByteBuffer payload, Runnable releaser) | |
| close | back to summary |
|---|---|
| public void close() Implements java. Doc from java. Closes this stream and releases any system resources associated with it. If the stream is already closed then invoking this method has no effect. As noted in
| |
| getCloseStatus | back to summary |
|---|---|
| public CloseStatus getCloseStatus() Implements org.
| |
| isReleaseable | back to summary |
|---|---|
| public boolean isReleaseable() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides org. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Modifier and Type | Method and Description |
|---|---|
| public Frame | |
| protected void | |
| public ByteBuffer | getPayload()
Overrides org. Get the payload ByteBuffer. |
| public void | |
| public Frame | |
| public Frame | |
| protected Frame | |
| public Frame | setPayload(ByteBuffer
the bytebuffer to set buf)Overrides org. Set the data payload. |
| public Frame | |
| public Frame | |
| public Frame | |
| public Frame | |
| public Frame |
| ReadOnly | back to summary |
|---|---|
| private ReadOnly(Frame frame) | |
| asReadOnly | back to summary |
|---|---|
| public Frame asReadOnly() Overrides org.
| |
| copyHeaders | back to summary |
|---|---|
| protected void copyHeaders(Frame frame) Overrides org.
| |
| getPayload | back to summary |
|---|---|
| public ByteBuffer getPayload() Overrides org. Doc from org. Get the payload ByteBuffer.
| |
| reset | back to summary |
|---|---|
| public void reset() Overrides org.
| |
| setFin | back to summary |
|---|---|
| public Frame setFin(boolean fin) Overrides org.
| |
| setMask | back to summary |
|---|---|
| public Frame setMask(byte[] maskingKey) Overrides org.
| |
| setOpCode | back to summary |
|---|---|
| protected Frame setOpCode(byte op) Overrides org.
| |
| setPayload | back to summary |
|---|---|
| public Frame setPayload(ByteBuffer buf) Overrides org. Doc from org. Set the data payload. The provided buffer will be used as is, no copying of bytes performed. The provided buffer should be flipped and ready to READ from.
| |
| setPayload | back to summary |
|---|---|
| public Frame setPayload(String str) Overrides org.
| |
| setPayload | back to summary |
|---|---|
| public Frame setPayload(byte[] buf) Overrides org.
| |
| setRsv1 | back to summary |
|---|---|
| public Frame setRsv1(boolean rsv1) Overrides org.
| |
| setRsv2 | back to summary |
|---|---|
| public Frame setRsv2(boolean rsv2) Overrides org.
| |
| setRsv3 | back to summary |
|---|---|
| public Frame setRsv3(boolean rsv3) Overrides org.
| |