|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.netty.handler.codec.http.websocket.DefaultWebSocketFrame
public class DefaultWebSocketFrame
The default WebSocketFrame implementation.
| Field Summary |
|---|
| Fields inherited from interface org.jboss.netty.handler.codec.http.websocket.WebSocketFrame |
|---|
CLOSING_HANDSHAKE |
| Constructor Summary | |
|---|---|
DefaultWebSocketFrame()
Creates a new empty text frame. |
|
DefaultWebSocketFrame(int type,
ChannelBuffer binaryData)
Creates a new frame with the specified frame type and the specified data. |
|
DefaultWebSocketFrame(java.lang.String textData)
Creates a new text frame from with the specified string. |
|
| Method Summary | |
|---|---|
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. |
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. |
java.lang.String |
toString()
Returns the string representation of this frame. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultWebSocketFrame()
public DefaultWebSocketFrame(java.lang.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.
java.lang.IllegalArgumentException - if If (type & 0x80 == 0) and the data is not encoded
in UTF-8| Method Detail |
|---|
public int getType()
WebSocketFrame0 is the
only allowed type according to the specification.
getType in interface WebSocketFramepublic boolean isText()
WebSocketFrametrue if and only if the content of this frame is a string
encoded in UTF-8.
isText in interface WebSocketFramepublic boolean isBinary()
WebSocketFrametrue if and only if the content of this frame is an
arbitrary binary data.
isBinary in interface WebSocketFramepublic ChannelBuffer getBinaryData()
WebSocketFrame
getBinaryData in interface WebSocketFramepublic java.lang.String getTextData()
WebSocketFrame
getTextData in interface WebSocketFrame
public void setData(int type,
ChannelBuffer binaryData)
WebSocketFrame
setData in interface WebSocketFrametype - 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 java.lang.String toString()
WebSocketFrameWebSocketFrame.getTextData().
toString in interface WebSocketFrametoString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||