public class WebSocketFrameImpl extends Object implements WebSocketFrameInternal, io.netty.util.ReferenceCounted
WebSocketFrameInternal implementation.factory| Constructor and Description |
|---|
WebSocketFrameImpl()
Creates a new empty text frame.
|
WebSocketFrameImpl(FrameType frameType)
Creates a new empty text frame.
|
WebSocketFrameImpl(FrameType type,
io.netty.buffer.ByteBuf binaryData)
Creates a new frame with the specified frame type and the specified data.
|
WebSocketFrameImpl(FrameType type,
io.netty.buffer.ByteBuf binaryData,
boolean isFinalFrame)
Creates a new frame with the specified frame type and the specified data.
|
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.
|
| Modifier and Type | Method and Description |
|---|---|
Buffer |
binaryData() |
String |
closeReason() |
short |
closeStatusCode() |
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 |
isText() |
int |
length() |
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() |
String |
toString() |
io.netty.util.ReferenceCounted |
touch() |
io.netty.util.ReferenceCounted |
touch(Object hint) |
FrameType |
type() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitbinaryFrame, continuationFrame, pingFrame, pongFrame, textFramepublic WebSocketFrameImpl()
public WebSocketFrameImpl(FrameType frameType)
public WebSocketFrameImpl(String textData)
public WebSocketFrameImpl(String textData, boolean isFinalFrame)
public WebSocketFrameImpl(FrameType 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(FrameType 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 boolean isText()
isText in interface WebSocketFramepublic boolean isBinary()
isBinary in interface WebSocketFramepublic boolean isContinuation()
isContinuation in interface WebSocketFramepublic boolean isClose()
isClose in interface WebSocketFramepublic 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 FrameType type()
type in interface WebSocketFrameInternalCopyright © 2020. All rights reserved.