org.jboss.netty.handler.codec.http.websocket

## Class DefaultWebSocketFrame

- java.lang.Object
- - org.jboss.netty.handler.codec.http.websocket.DefaultWebSocketFrame

- All Implemented Interfaces:
    WebSocketFrame

  Deprecated.
  Use `org.jboss.netty.handler.codec.http.websocketx` instead. The default `WebSocketFrame` implementation.

      @Deprecated
      public class DefaultWebSocketFrame
      extends Object
      implements WebSocketFrame

- - ### Field Summary

    - ### Fields inherited from interface org.jboss.netty.handler.codec.http.websocket.WebSocketFrame

      `CLOSING_HANDSHAKE`

  - ### Constructor Summary

    Constructors
    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.

  - ### Method Summary

    Methods
    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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultWebSocketFrame

          public DefaultWebSocketFrame()

      Deprecated.
      Creates a new empty text frame.

    - #### DefaultWebSocketFrame

          public DefaultWebSocketFrame(String textData)

      Deprecated.
      Creates a new text frame from with the specified string.

    - #### DefaultWebSocketFrame

          public DefaultWebSocketFrame(int type,
                               ChannelBuffer binaryData)

      Deprecated.
      Creates a new frame with the specified frame type and the specified data.
      Parameters:
        `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.
      Throws:
        `IllegalArgumentException` - if If `(type & 0x80 == 0)` and the data is not encoded in UTF-8

  - ### Method Detail

    - #### getType

          public int getType()

      Deprecated.
      Description copied from interface: `WebSocketFrame`
      Returns the type of this frame. `0x00-0x7F` means a text frame encoded in UTF-8, and `0x80-0xFF` means a binary frame. Currently, `0` is the only allowed type according to the specification.
      Specified by:
        `getType` in interface `WebSocketFrame`

    - #### isText

          public boolean isText()

      Deprecated.
      Description copied from interface: `WebSocketFrame`
      Returns `true` if and only if the content of this frame is a string encoded in UTF-8.
      Specified by:
        `isText` in interface `WebSocketFrame`

    - #### isBinary

          public boolean isBinary()

      Deprecated.
      Description copied from interface: `WebSocketFrame`
      Returns `true` if and only if the content of this frame is an arbitrary binary data.
      Specified by:
        `isBinary` in interface `WebSocketFrame`

    - #### getBinaryData

          public ChannelBuffer getBinaryData()

      Deprecated.
      Description copied from interface: `WebSocketFrame`
      Returns the content of this frame as-is, with no UTF-8 decoding.
      Specified by:
        `getBinaryData` in interface `WebSocketFrame`

    - #### getTextData

          public String getTextData()

      Deprecated.
      Description copied from interface: `WebSocketFrame`
      Converts the content of this frame into a UTF-8 string and returns the converted string.
      Specified by:
        `getTextData` in interface `WebSocketFrame`

    - #### setData

          public void setData(int type,
                     ChannelBuffer binaryData)

      Deprecated.
      Description copied from interface: `WebSocketFrame`
      Sets the type and the content of this frame.
      Specified by:
        `setData` in interface `WebSocketFrame`
      Parameters:
        `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.

    - #### toString

          public String toString()

      Deprecated.
      Description copied from interface: `WebSocketFrame`
      Returns the string representation of this frame. Please note that this method is not identical to `WebSocketFrame.getTextData()`.
      Specified by:
        `toString` in interface `WebSocketFrame`
      Overrides:
        `toString` in class `Object`

Copyright © 2008-2012 The Netty Project. All Rights Reserved.