public class WebSocketFrameImpl extends Object implements WebSocketFrameInternal, io.netty.util.ReferenceCounted
WebSocketFrameInternal implementation.| Constructor and Description |
|---|
WebSocketFrameImpl()
Creates a new empty text frame.
|
WebSocketFrameImpl(String textData)
Creates a new text frame from with the specified string.
|
WebSocketFrameImpl(String textData,
boolean isFinalFrame)
Creates a new text frame from with the specified string.
|
WebSocketFrameImpl(WebSocketFrameType frameType)
Creates a new empty text frame.
|
WebSocketFrameImpl(WebSocketFrameType type,
io.netty.buffer.ByteBuf binaryData)
Creates a new frame with the specified frame type and the specified data.
|
WebSocketFrameImpl(WebSocketFrameType type,
io.netty.buffer.ByteBuf binaryData,
boolean isFinalFrame)
Creates a new frame with the specified frame type and the specified data.
|
| Modifier and Type | Method and Description |
|---|---|
Buffer |
binaryData() |
static WebSocketFrame |
binaryFrame(Buffer data,
boolean isFinal)
Create a binary WebSocket frame.
|
String |
closeReason() |
short |
closeStatusCode() |
static WebSocketFrame |
continuationFrame(Buffer data,
boolean isFinal)
Create a continuation frame
|
io.netty.buffer.ByteBuf |
getBinaryData()
Returns the content of this frame as-is, with no UTF-8 decoding.
|
boolean |
isBinary() |
boolean |
isClose() |
boolean |
isContinuation() |
boolean |
isFinal() |
boolean |
isPing() |
boolean |
isText() |
int |
length() |
static WebSocketFrame |
pingFrame(Buffer data)
Create a ping WebSocket frame.
|
static WebSocketFrame |
pongFrame(Buffer data)
Create a pong WebSocket frame.
|
int |
refCnt() |
boolean |
release() |
boolean |
release(int decrement) |
io.netty.util.ReferenceCounted |
retain() |
io.netty.util.ReferenceCounted |
retain(int increment) |
void |
setBinaryData(io.netty.buffer.ByteBuf binaryData)
Sets the type and the content of this frame.
|
void |
setTextData(String textData)
Set the type of the content of this frame and populate it with the given content
|
String |
textData() |
static WebSocketFrame |
textFrame(String str,
boolean isFinal)
Create a text WebSocket frame.
|
String |
toString() |
io.netty.util.ReferenceCounted |
touch() |
io.netty.util.ReferenceCounted |
touch(Object hint) |
WebSocketFrameType |
type() |
public WebSocketFrameImpl()
public WebSocketFrameImpl(WebSocketFrameType frameType)
public WebSocketFrameImpl(String textData)
public WebSocketFrameImpl(String textData, boolean isFinalFrame)
public WebSocketFrameImpl(WebSocketFrameType type, io.netty.buffer.ByteBuf binaryData)
type - the type of the frame. 0 is the only allowed type currently.binaryData - the content of the frame. If (type & 0x80 == 0),
it must be encoded in UTF-8.IllegalArgumentException - if If (type & 0x80 == 0) and the data is not encoded
in UTF-8public WebSocketFrameImpl(WebSocketFrameType type, io.netty.buffer.ByteBuf binaryData, boolean isFinalFrame)
type - the type of the frame. 0 is the only allowed type currently.binaryData - the content of the frame. If (type & 0x80 == 0),
it must be encoded in UTF-8.isFinalFrame - If this is the final frame in a sequenceIllegalArgumentException - if If (type & 0x80 == 0) and the data is not encoded
in UTF-8public static WebSocketFrame binaryFrame(Buffer data, boolean isFinal)
WebSocketFramebinaryFrame in interface WebSocketFramedata - the data for the frameisFinal - true if it's the final frame in the WebSocket messagepublic static WebSocketFrame textFrame(String str, boolean isFinal)
WebSocketFrametextFrame in interface WebSocketFramestr - the string for the frameisFinal - true if it's the final frame in the WebSocket messagepublic static WebSocketFrame continuationFrame(Buffer data, boolean isFinal)
WebSocketFramecontinuationFrame in interface WebSocketFramedata - the data for the frameisFinal - true if it's the final frame in the WebSocket messagepublic static WebSocketFrame pingFrame(Buffer data)
WebSocketFramepingFrame in interface WebSocketFramedata - the bytes for the frame, may be at most 125 bytespublic static WebSocketFrame pongFrame(Buffer data)
WebSocketFramepongFrame in interface WebSocketFramedata - the bytes for the frame, may be at most 125 bytespublic boolean isText()
isText in interface WebSocketFrameWebSocketFrameType.TEXT framepublic boolean isBinary()
isBinary in interface WebSocketFrameWebSocketFrameType.BINARY framepublic boolean isContinuation()
isContinuation in interface WebSocketFrameWebSocketFrameType.CONTINUATION framepublic boolean isClose()
isClose in interface WebSocketFrameWebSocketFrameType.CLOSE framepublic boolean isPing()
isPing in interface WebSocketFrameWebSocketFrameType.PING framepublic io.netty.buffer.ByteBuf getBinaryData()
WebSocketFrameInternalgetBinaryData in interface WebSocketFrameInternalpublic String textData()
textData in interface WebSocketFramepublic Buffer binaryData()
binaryData in interface WebSocketFramepublic void setBinaryData(io.netty.buffer.ByteBuf binaryData)
WebSocketFrameInternalsetBinaryData in interface WebSocketFrameInternalbinaryData - the content of the frame. If (type & 0x80 == 0),
it must be encoded in UTF-8.public void setTextData(String textData)
WebSocketFrameInternalsetTextData in interface WebSocketFrameInternaltextData - the content of the frame. Must be valid UTF-8public int length()
length in interface WebSocketFrameInternalpublic int refCnt()
refCnt in interface io.netty.util.ReferenceCountedpublic io.netty.util.ReferenceCounted retain()
retain in interface io.netty.util.ReferenceCountedpublic io.netty.util.ReferenceCounted retain(int increment)
retain in interface io.netty.util.ReferenceCountedpublic boolean release()
release in interface io.netty.util.ReferenceCountedpublic boolean release(int decrement)
release in interface io.netty.util.ReferenceCountedpublic io.netty.util.ReferenceCounted touch()
touch in interface io.netty.util.ReferenceCountedpublic io.netty.util.ReferenceCounted touch(Object hint)
touch in interface io.netty.util.ReferenceCountedpublic boolean isFinal()
isFinal in interface WebSocketFramepublic short closeStatusCode()
closeStatusCode in interface WebSocketFramepublic String closeReason()
closeReason in interface WebSocketFramepublic WebSocketFrameType type()
type in interface WebSocketFrameCopyright © 2021. All rights reserved.