public interface WebSocketFrame
Modifier and Type | Interface and Description |
---|---|
static class |
WebSocketFrame.FrameType
List of all frame types.
|
Modifier and Type | Method and Description |
---|---|
org.jboss.netty.buffer.ChannelBuffer |
getBinaryData()
Returns the content of this frame as-is, with no UTF-8 decoding.
|
java.lang.String |
getTextData()
Converts the content of this frame into a UTF-8 string and returns the
converted string.
|
WebSocketFrame.FrameType |
getType() |
boolean |
isBinary()
Returns
true if and only if the content of this frame is an
arbitrary binary data. |
boolean |
isText()
Returns
true if and only if the content of this frame is a string
encoded in UTF-8. |
void |
setBinaryData(org.jboss.netty.buffer.ChannelBuffer binaryData)
Sets the type and the content of this frame.
|
void |
setTextData(java.lang.String textData) |
java.lang.String |
toString()
Returns the string representation of this frame.
|
WebSocketFrame.FrameType getType()
boolean isText()
true
if and only if the content of this frame is a string
encoded in UTF-8.boolean isBinary()
true
if and only if the content of this frame is an
arbitrary binary data.org.jboss.netty.buffer.ChannelBuffer getBinaryData()
java.lang.String getTextData()
void setBinaryData(org.jboss.netty.buffer.ChannelBuffer binaryData)
binaryData
- the content of the frame. If (type & 0x80 == 0),
it must be encoded in UTF-8.java.lang.IllegalArgumentException
- if If (type & 0x80 == 0) and the data is not encoded
in UTF-8void setTextData(java.lang.String textData)
java.lang.String toString()
getTextData()
.toString
in class java.lang.Object