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

# Interface Encoder.TextStream<T>

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

All Superinterfaces:
  `Encoder`

Enclosing interface:
  `Encoder`

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

- ## 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, Writer writer)`
  Encodes the given object and writes the result to the writer.

  ### Methods inherited from interface Encoder

  `destroy, init`

- ## Method Details

  - ### encode

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