Top Description Constructors Methods
io.netty5.handler.codec.http.websocketx

public Class TextWebSocketFrame

extends WebSocketFrame
Class Inheritance
Imports
io.netty5.buffer.Buffer, .BufferAllocator

Web Socket text frame.

Constructor Summary

AccessConstructor and Description
public
TextWebSocketFrame(BufferAllocator
BufferAllocator to use for allocating data.
allocator
,
String
String to put in the frame.
text
)

Creates a new text frame with the specified text string.

public
TextWebSocketFrame(Buffer
the content of the frame.
binaryData
)

Creates a new text frame with the specified binary data.

public
TextWebSocketFrame(BufferAllocator
BufferAllocator to use for allocating data.
allocator
,
boolean
flag indicating if this frame is the final fragment
finalFragment
,
int
reserved bits used for protocol extensions
rsv
,
String
String to put in the frame.
text
)

Creates a new text frame with the specified text string.

private
public
TextWebSocketFrame(boolean
flag indicating if this frame is the final fragment
finalFragment
,
int
reserved bits used for protocol extensions
rsv
,
Buffer
the content of the frame.
binaryData
)

Creates a new text frame with the specified binary data and the final fragment flag.

Method Summary

Modifier and TypeMethod and Description
private static Buffer
fromText(BufferAllocator allocator, String text)

protected WebSocketFrame
receive(Buffer
The Buffer that is received by the recipient, and needs to be wrapped in a new BufferHolder instance.
buf
)

Implements abstract io.netty5.buffer.BufferHolder.receive.

Called when a sent BufferHolder is received by the recipient.
public String
text()

Returns the text data in this frame.

Inherited from io.netty5.handler.codec.http.websocketx.WebSocketFrame:
binaryDataisFinalFragmentrsvtoString

Constructor Detail

TextWebSocketFrameback to summary
public TextWebSocketFrame(BufferAllocator allocator, String text)

Creates a new text frame with the specified text string. The final fragment flag is set to true.

Parameters
allocator:BufferAllocator

BufferAllocator to use for allocating data.

text:String

String to put in the frame.

TextWebSocketFrameback to summary
public TextWebSocketFrame(Buffer binaryData)

Creates a new text frame with the specified binary data. The final fragment flag is set to true.

Parameters
binaryData:Buffer

the content of the frame.

TextWebSocketFrameback to summary
public TextWebSocketFrame(BufferAllocator allocator, boolean finalFragment, int rsv, String text)

Creates a new text frame with the specified text string. The final fragment flag is set to true.

Parameters
allocator:BufferAllocator

BufferAllocator to use for allocating data.

finalFragment:boolean

flag indicating if this frame is the final fragment

rsv:int

reserved bits used for protocol extensions

text:String

String to put in the frame.

TextWebSocketFrameback to summary
private TextWebSocketFrame(TextWebSocketFrame copyFrom, Buffer data)
TextWebSocketFrameback to summary
public TextWebSocketFrame(boolean finalFragment, int rsv, Buffer binaryData)

Creates a new text frame with the specified binary data and the final fragment flag.

Parameters
finalFragment:boolean

flag indicating if this frame is the final fragment

rsv:int

reserved bits used for protocol extensions

binaryData:Buffer

the content of the frame.

Method Detail

fromTextback to summary
private static Buffer fromText(BufferAllocator allocator, String text)
receiveback to summary
protected WebSocketFrame receive(Buffer buf)

Implements abstract io.netty5.buffer.BufferHolder.receive.

Doc from io.netty5.buffer.BufferHolder.receive.

Called when a sent BufferHolder is received by the recipient. The BufferHolder should return a new concrete instance, that wraps the given Buffer object.

Parameters
buf:Buffer

The Buffer that is received by the recipient, and needs to be wrapped in a new BufferHolder instance.

Returns:WebSocketFrame

A new buffer holder instance, containing the given buffer.

Annotations
@Override
textback to summary
public String text()

Returns the text data in this frame.