javax.websocket

## Interface Encoder.Binary<T>

- Type Parameters:
    `T` - The type of the custom object that this Encoder can encoder to a ByteBuffer.
  All Superinterfaces:
    Encoder
  Enclosing interface:
    Encoder

      public static interface Encoder.Binary<T>
      extends Encoder

  This interface defines how to provide a way to convert a custom object into a binary message.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface javax.websocket.Encoder

      `Encoder.Binary<T>, Encoder.BinaryStream<T>, Encoder.Text<T>, Encoder.TextStream<T>`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ByteBuffer` | `encode(T object)` Encode the given object into a byte array.

    - ### Methods inherited from interface javax.websocket.Encoder

      `destroy, init`

- - ### Method Detail

    - #### encode

          ByteBuffer encode(T object)
                            throws EncodeException

      Encode the given object into a byte array.
      Parameters:
        `object` - the object being encoded.
      Returns:
        the binary data.
      Throws:
        `EncodeException`

Copyright © 1996-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.