Class Parser
java.lang.Object
org.eclipse.jetty.websocket.core.internal.Parser
Parsing of a frames in WebSocket land.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionParser
(ByteBufferPool bufferPool) Parser
(ByteBufferPool bufferPool, Configuration configuration) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkFrameSize
(byte opcode, int payloadLength) int
protected Parser.ParsedFrame
newFrame
(byte firstByte, byte[] mask, ByteBuffer payload, boolean releaseable) parse
(ByteBuffer buffer) Parse the buffer.void
reset()
toString()
-
Constructor Details
-
Parser
-
Parser
-
-
Method Details
-
getPayloadLength
public int getPayloadLength() -
reset
public void reset() -
parse
Parse the buffer.- Parameters:
buffer
- the buffer to parse from.- Returns:
- Frame or null if not enough data for a complete frame.
- Throws:
WebSocketException
- if unable to parse properly
-
checkFrameSize
protected void checkFrameSize(byte opcode, int payloadLength) throws MessageTooLargeException, ProtocolException -
newFrame
protected Parser.ParsedFrame newFrame(byte firstByte, byte[] mask, ByteBuffer payload, boolean releaseable) -
toString
-