Interface WebSocketFrame
- All Superinterfaces:
AutoCloseable
,Bytes
,SafeCloseable
- All Known Subinterfaces:
CloseWebSocketFrame
A
WebSocketFrame
to send data to the peer.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Tells whether this frame is a final fragment or not.static WebSocketFrame
ofBinary
(byte[] data) static WebSocketFrame
ofBinary
(byte[] data, boolean finalFragment) Returns a new binaryWebSocketFrame
with thefinalFragment
.static CloseWebSocketFrame
ofClose
(byte[] data) static CloseWebSocketFrame
ofClose
(WebSocketCloseStatus status) Returns a newCloseWebSocketFrame
with theWebSocketCloseStatus
.static CloseWebSocketFrame
ofClose
(WebSocketCloseStatus status, String reason) Returns a newCloseWebSocketFrame
with theWebSocketCloseStatus
and the reason.static WebSocketFrame
ofContinuation
(byte[] data) static WebSocketFrame
ofContinuation
(byte[] data, boolean finalFragment) Returns a new continuationWebSocketFrame
with the data andfinalFragment
.static WebSocketFrame
ofContinuation
(String text) static WebSocketFrame
ofContinuation
(String text, boolean finalFragment) Returns a new text continuationWebSocketFrame
with the text andfinalFragment
.static WebSocketFrame
ofPing()
Returns a pingWebSocketFrame
.static WebSocketFrame
ofPing
(byte[] data) Returns a new pingWebSocketFrame
with thedata
.static WebSocketFrame
ofPong()
Returns a pongWebSocketFrame
.static WebSocketFrame
ofPong
(byte[] data) Returns a new pongWebSocketFrame
with thedata
.static WebSocketFrame
ofPooledBinary
(ByteBuf data) (Advanced users only) Returns a new binaryWebSocketFrame
with theByteBuf
whoseisFinalFragment()
is set totrue
.static WebSocketFrame
ofPooledBinary
(ByteBuf data, boolean finalFragment) static CloseWebSocketFrame
ofPooledClose
(ByteBuf data) (Advanced users only) Returns a newCloseWebSocketFrame
with theByteBuf
.static WebSocketFrame
ofPooledContinuation
(ByteBuf data) (Advanced users only) Returns a new continuationWebSocketFrame
with theByteBuf
whoseisFinalFragment()
is set totrue
.static WebSocketFrame
ofPooledContinuation
(ByteBuf data, boolean finalFragment) static WebSocketFrame
ofPooledPing
(ByteBuf data) (Advanced users only) Returns a new pingWebSocketFrame
with theByteBuf
.static WebSocketFrame
ofPooledPong
(ByteBuf data) (Advanced users only) Returns a new pongWebSocketFrame
with theByteBuf
.static WebSocketFrame
ofPooledText
(ByteBuf text) (Advanced users only) Returns a new textWebSocketFrame
with theByteBuf
whoseisFinalFragment()
is set totrue
.static WebSocketFrame
ofPooledText
(ByteBuf text, boolean finalFragment) static WebSocketFrame
ofText
(byte[] text) Returns a new textWebSocketFrame
with the UTF-8 encoded text whoseisFinalFragment()
is set totrue
.static WebSocketFrame
ofText
(byte[] text, boolean finalFragment) Returns a new textWebSocketFrame
with the UTF-8 encoded text andfinalFragment
.static WebSocketFrame
static WebSocketFrame
Returns a new textWebSocketFrame
with the text andfinalFragment
.text()
Returns the text data in this frame.type()
Returns the type of this frame.Methods inherited from interface com.linecorp.armeria.common.Bytes
array, byteBuf, byteBuf, byteBuf, close, isEmpty, isPooled, length, toInputStream, toReader, toReaderAscii, toReaderUtf8, toString, toStringAscii, toStringUtf8, touch
-
Method Details
-
ofText
- See Also:
-
ofText
Returns a new textWebSocketFrame
with the text andfinalFragment
. When thefinalFragment
isfalse
,ofContinuation(byte[])
frames must be followed.- See Also:
-
ofText
Returns a new textWebSocketFrame
with the UTF-8 encoded text whoseisFinalFragment()
is set totrue
.- See Also:
-
ofText
Returns a new textWebSocketFrame
with the UTF-8 encoded text andfinalFragment
. When thefinalFragment
isfalse
,ofContinuation(byte[])
frames must be followed.- See Also:
-
ofBinary
- See Also:
-
ofBinary
Returns a new binaryWebSocketFrame
with thefinalFragment
. When thefinalFragment
isfalse
,ofContinuation(byte[])
frames must be followed.- See Also:
-
ofClose
Returns a newCloseWebSocketFrame
with theWebSocketCloseStatus
.- See Also:
-
ofClose
Returns a newCloseWebSocketFrame
with theWebSocketCloseStatus
and the reason.- See Also:
-
ofClose
- See Also:
-
ofPing
Returns a pingWebSocketFrame
.- See Also:
-
ofPing
Returns a new pingWebSocketFrame
with thedata
.- See Also:
-
ofPong
Returns a pongWebSocketFrame
.- See Also:
-
ofPong
Returns a new pongWebSocketFrame
with thedata
.- See Also:
-
ofContinuation
Returns a new continuationWebSocketFrame
whoseisFinalFragment()
is set totrue
.isText
must betrue
if this continuation frame follows a text frame.false
if this follows a binary frame.- See Also:
-
ofContinuation
Returns a new continuationWebSocketFrame
with the data andfinalFragment
.isText
must betrue
if this continuation frame follows a text frame.false
if this follows a binary frame.- See Also:
-
ofContinuation
- See Also:
-
ofContinuation
Returns a new text continuationWebSocketFrame
with the text andfinalFragment
.- See Also:
-
ofPooledText
(Advanced users only) Returns a new textWebSocketFrame
with theByteBuf
whoseisFinalFragment()
is set totrue
.- See Also:
-
ofPooledText
(Advanced users only) Returns a new textWebSocketFrame
with theByteBuf
andfinalFragment
. When thefinalFragment
isfalse
,ofPooledContinuation(ByteBuf)
frames must be followed.- See Also:
-
ofPooledBinary
(Advanced users only) Returns a new binaryWebSocketFrame
with theByteBuf
whoseisFinalFragment()
is set totrue
.- See Also:
-
ofPooledBinary
(Advanced users only) Returns a new binaryWebSocketFrame
with theByteBuf
andfinalFragment
. When thefinalFragment
isfalse
,ofPooledContinuation(ByteBuf)
frames must be followed.- See Also:
-
ofPooledClose
(Advanced users only) Returns a newCloseWebSocketFrame
with theByteBuf
.- See Also:
-
ofPooledPing
(Advanced users only) Returns a new pingWebSocketFrame
with theByteBuf
.- See Also:
-
ofPooledPong
(Advanced users only) Returns a new pongWebSocketFrame
with theByteBuf
.- See Also:
-
ofPooledContinuation
(Advanced users only) Returns a new continuationWebSocketFrame
with theByteBuf
whoseisFinalFragment()
is set totrue
.isText
must betrue
if this continuation frame follows a text frame.false
if this follows a binary frame.- See Also:
-
ofPooledContinuation
(Advanced users only) Returns a new binaryWebSocketFrame
with theByteBuf
andfinalFragment
.isText
must betrue
if this continuation frame follows a text frame.false
if this follows a binary frame.- See Also:
-
type
WebSocketFrameType type()Returns the type of this frame. -
isFinalFragment
boolean isFinalFragment()Tells whether this frame is a final fragment or not.- See Also:
-
text
String text()Returns the text data in this frame.
-