Decoder.Binary (WebSocket 2.1 API Documentation - Apache Tomcat 10.1.57)
Description: declaration: package: jakarta.websocket, interface: Decoder, interface: Binary

# Interface Decoder.Binary<T>

Type Parameters:
  `T` - The type of object produced by the decoder

All Superinterfaces:
  `Decoder`

Enclosing interface:
  `Decoder`

public static interface Decoder.Binary<T> extends Decoder
A decoder that decodes entire binary WebSocket messages into an object of type T.

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from interface Decoder

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `T`
  `decode(ByteBuffer bytes)`
  Decodes the binary data into an object.
  `boolean`
  `willDecode(ByteBuffer bytes)`
  Determines whether this decoder can decode the given binary data.

  ### Methods inherited from interface Decoder

  `destroy, init`

- ## Method Details

  - ### decode

    T decode(ByteBuffer bytes) throws DecodeException
    Decodes the binary data into an object.
    Parameters:
      `bytes` - The binary data to decode
    Returns:
      The decoded object
    Throws:
      `DecodeException` - If the data cannot be decoded

  - ### willDecode

    boolean willDecode(ByteBuffer bytes)
    Determines whether this decoder can decode the given binary data.
    Parameters:
      `bytes` - The binary data to check
    Returns:
      `true` if this decoder can decode the data