Package ej.websocket.frame
Class ClientFrameBuilder
- java.lang.Object
-
- ej.websocket.frame.ClientFrameBuilder
-
- All Implemented Interfaces:
IFrameBuilder
public class ClientFrameBuilder extends Object implements IFrameBuilder
This build will create frames that a client can send. That is, it will mask the payload, set the MASK bit and add the masking to the frame.
-
-
Field Summary
-
Fields inherited from interface ej.websocket.frame.IFrameBuilder
EXTENDED_LENGTH_MAX_VALUE
-
-
Constructor Summary
Constructors Constructor Description ClientFrameBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RawFramebuildBinaryFrame(byte[] binary)See RFC6455, section 5.6.RawFramebuildCloseFrame(ReasonForClosure reasonForClosure)See RFC6455, section 7.RawFramebuildPingFrame(byte[] binary)See RFC6455, section 5.5.2.RawFramebuildPongFrame(byte[] binary)See RFC6455, section 5.5.3.RawFramebuildTextFrame(String text)See RFC6455, section 5.6.
-
-
-
Method Detail
-
buildBinaryFrame
public RawFrame buildBinaryFrame(byte[] binary)
Description copied from interface:IFrameBuilderSee RFC6455, section 5.6. Data Frames.- Specified by:
buildBinaryFramein interfaceIFrameBuilder- Parameters:
binary- the binary data to create a binary frame- Returns:
- the properly constructed frame
-
buildCloseFrame
public RawFrame buildCloseFrame(ReasonForClosure reasonForClosure)
Description copied from interface:IFrameBuilderSee RFC6455, section 7. Closing the Connection.- Specified by:
buildCloseFramein interfaceIFrameBuilder- Parameters:
reasonForClosure- the status code and the optional message to send to the remote endpoint- Returns:
- the properly constructed frame
-
buildPingFrame
public RawFrame buildPingFrame(byte[] binary)
Description copied from interface:IFrameBuilderSee RFC6455, section 5.5.2. Ping.- Specified by:
buildPingFramein interfaceIFrameBuilder- Parameters:
binary- the payload of the frame- Returns:
- the properly constructed frame
-
buildPongFrame
public RawFrame buildPongFrame(byte[] binary)
Description copied from interface:IFrameBuilderSee RFC6455, section 5.5.3. Pong.- Specified by:
buildPongFramein interfaceIFrameBuilder- Parameters:
binary- the payload of the frame- Returns:
- the properly constructed frame
-
buildTextFrame
public RawFrame buildTextFrame(String text)
Description copied from interface:IFrameBuilderSee RFC6455, section 5.6. Data Frames.- Specified by:
buildTextFramein interfaceIFrameBuilder- Parameters:
text- the text to create a text frame- Returns:
- the properly constructed frame
-
-