public class TextWebSocketFrame extends WebSocketFrame
Constructor and Description |
---|
TextWebSocketFrame()
Creates a new empty text frame.
|
TextWebSocketFrame(boolean finalFragment,
int rsv,
ByteBuf binaryData)
Creates a new text frame with the specified binary data.
|
TextWebSocketFrame(boolean finalFragment,
int rsv,
java.lang.String text)
Creates a new text frame with the specified text string.
|
TextWebSocketFrame(ByteBuf binaryData)
Creates a new text frame with the specified binary data.
|
TextWebSocketFrame(java.lang.String text)
Creates a new text frame with the specified text string.
|
Modifier and Type | Method and Description |
---|---|
TextWebSocketFrame |
copy()
Create a deep copy of this
ByteBufHolder . |
TextWebSocketFrame |
duplicate()
Duplicate the
ByteBufHolder . |
private static ByteBuf |
fromText(java.lang.String text) |
TextWebSocketFrame |
retain()
Increases the reference count by
1 . |
TextWebSocketFrame |
retain(int increment)
Increases the reference count by the specified
increment . |
java.lang.String |
text()
Returns the text data in this frame
|
isFinalFragment, rsv, toString
content, contentToString, equals, hashCode, refCnt, release, release
public TextWebSocketFrame()
public TextWebSocketFrame(java.lang.String text)
text
- String to put in the framepublic TextWebSocketFrame(ByteBuf binaryData)
binaryData
- the content of the frame. Must be UTF-8 encodedpublic TextWebSocketFrame(boolean finalFragment, int rsv, java.lang.String text)
finalFragment
- flag indicating if this frame is the final fragmentrsv
- reserved bits used for protocol extensionstext
- String to put in the framepublic TextWebSocketFrame(boolean finalFragment, int rsv, ByteBuf binaryData)
finalFragment
- flag indicating if this frame is the final fragmentrsv
- reserved bits used for protocol extensionsbinaryData
- the content of the frame. Must be UTF-8 encodedprivate static ByteBuf fromText(java.lang.String text)
public java.lang.String text()
public TextWebSocketFrame copy()
ByteBufHolder
ByteBufHolder
.copy
in interface ByteBufHolder
copy
in class WebSocketFrame
public TextWebSocketFrame duplicate()
ByteBufHolder
ByteBufHolder
. Be aware that this will not automatically call ByteBufHolder.retain()
.duplicate
in interface ByteBufHolder
duplicate
in class WebSocketFrame
public TextWebSocketFrame retain()
ReferenceCounted
1
.retain
in interface ByteBufHolder
retain
in interface ReferenceCounted
retain
in class WebSocketFrame
public TextWebSocketFrame retain(int increment)
ReferenceCounted
increment
.retain
in interface ByteBufHolder
retain
in interface ReferenceCounted
retain
in class WebSocketFrame