WebSocketFrame
implementation.@Deprecated public class DefaultWebSocketFrame extends Object implements WebSocketFrame
CLOSING_HANDSHAKE
Constructor and Description |
---|
DefaultWebSocketFrame()
Deprecated.
Creates a new empty text frame.
|
DefaultWebSocketFrame(int type,
ChannelBuffer binaryData)
Deprecated.
Creates a new frame with the specified frame type and the specified data.
|
DefaultWebSocketFrame(String textData)
Deprecated.
Creates a new text frame from with the specified string.
|
Modifier and Type | Method and Description |
---|---|
ChannelBuffer |
getBinaryData()
Deprecated.
Returns the content of this frame as-is, with no UTF-8 decoding.
|
String |
getTextData()
Deprecated.
Converts the content of this frame into a UTF-8 string and returns the
converted string.
|
int |
getType()
Deprecated.
Returns the type of this frame.
|
boolean |
isBinary()
Deprecated.
Returns
true if and only if the content of this frame is an
arbitrary binary data. |
boolean |
isText()
Deprecated.
Returns
true if and only if the content of this frame is a string
encoded in UTF-8. |
void |
setData(int type,
ChannelBuffer binaryData)
Deprecated.
Sets the type and the content of this frame.
|
String |
toString()
Deprecated.
Returns the string representation of this frame.
|
public DefaultWebSocketFrame()
public DefaultWebSocketFrame(String textData)
public DefaultWebSocketFrame(int type, ChannelBuffer 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 int getType()
WebSocketFrame
0
is the
only allowed type according to the specification.getType
in interface WebSocketFrame
public boolean isText()
WebSocketFrame
true
if and only if the content of this frame is a string
encoded in UTF-8.isText
in interface WebSocketFrame
public boolean isBinary()
WebSocketFrame
true
if and only if the content of this frame is an
arbitrary binary data.isBinary
in interface WebSocketFrame
public ChannelBuffer getBinaryData()
WebSocketFrame
getBinaryData
in interface WebSocketFrame
public String getTextData()
WebSocketFrame
getTextData
in interface WebSocketFrame
public void setData(int type, ChannelBuffer binaryData)
WebSocketFrame
setData
in interface WebSocketFrame
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.public String toString()
WebSocketFrame
WebSocketFrame.getTextData()
.toString
in interface WebSocketFrame
toString
in class Object
Copyright © 2008-2013 The Netty Project. All Rights Reserved.