|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface WebSocketFrame
A Web Socket frame that represents either text or binary data.
Field Summary | |
---|---|
static WebSocketFrame |
CLOSING_HANDSHAKE
Closing handshake message (0xFF, 0x00) |
Method Summary | |
---|---|
ChannelBuffer |
getBinaryData()
Returns the content of this frame as-is, with no UTF-8 decoding. |
String |
getTextData()
Converts the content of this frame into a UTF-8 string and returns the converted string. |
int |
getType()
Returns the type of this frame. |
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 |
setData(int type,
ChannelBuffer binaryData)
Sets the type and the content of this frame. |
String |
toString()
Returns the string representation of this frame. |
Field Detail |
---|
static final WebSocketFrame CLOSING_HANDSHAKE
Method Detail |
---|
int getType()
0
is the
only allowed type according to the specification.
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.
ChannelBuffer getBinaryData()
String getTextData()
void setData(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-8String toString()
getTextData()
.
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |