Encoder.BinaryStream (WebSocket 2.2 API Documentation - Apache Tomcat 11.0.24)
Description: declaration: package: jakarta.websocket, interface: Encoder, interface: BinaryStream

# Interface Encoder.BinaryStream<T>

Type Parameters:
  `T` - The type of object accepted by the encoder

All Superinterfaces:
  `Encoder`

Enclosing interface:
  `Encoder`

public static interface Encoder.BinaryStream<T> extends Encoder
An encoder that encodes an object of type T into a binary WebSocket message written to an `OutputStream`.

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from interface Encoder

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `encode(T object, OutputStream os)`
  Encodes the given object and writes the result to the output stream.

  ### Methods inherited from interface Encoder

  `destroy, init`

- ## Method Details

  - ### encode

    void encode(T object, OutputStream os) throws EncodeException, IOException
    Encodes the given object and writes the result to the output stream.
    Parameters:
      `object` - The object to encode
      `os` - The output stream to write the encoded data to
    Throws:
      `EncodeException` - If the object cannot be encoded
      `IOException` - If an I/O error occurs