Class WebSocketFrame
java.lang.Object
com.predic8.membrane.core.transport.ws.WebSocketFrame
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWebSocketFrame(boolean fin, boolean rsv1, boolean rsv2, boolean rsv3, int opcode, boolean isMasked, byte[] maskingKey, byte[] payload) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]intbyte[]longbooleanisMasked()voidsetMasked(boolean masked) voidsetMaskKey(byte[] maskKey) voidsetOpcode(int opcode) voidsetOriginalExchange(Exchange originalExchange) voidsetPayload(byte[] payload) voidsetPayloadLength(long payloadLength) byte[]toBytes()toString()inttryRead(byte[] buffer, int offset, int length) voidwrite(OutputStream out)
-
Field Details
-
log
protected static org.slf4j.Logger log
-
-
Constructor Details
-
WebSocketFrame
public WebSocketFrame() -
WebSocketFrame
public WebSocketFrame(boolean fin, boolean rsv1, boolean rsv2, boolean rsv3, int opcode, boolean isMasked, byte[] maskingKey, byte[] payload)
-
-
Method Details
-
write
- Throws:
IOException
-
getOpcode
public int getOpcode() -
setOpcode
public void setOpcode(int opcode) -
isMasked
public boolean isMasked() -
setMasked
public void setMasked(boolean masked) -
getPayloadLength
public long getPayloadLength() -
setPayloadLength
public void setPayloadLength(long payloadLength) -
getMaskKey
public byte[] getMaskKey() -
setMaskKey
public void setMaskKey(byte[] maskKey) -
getPayload
public byte[] getPayload() -
setPayload
public void setPayload(byte[] payload) -
tryRead
public int tryRead(byte[] buffer, int offset, int length) - Parameters:
buffer-offset-length-- Returns:
- the number of bytes read. if > 0, this class has been properly initialized with the frame data read.
-
toString
-
toStringHex
-
toBytes
- Throws:
IOException
-
getOriginalExchange
-
setOriginalExchange
-