org.apache.hc.core5.http.nio.support.classic

## Interface ContentOutputBuffer

- All Known Implementing Classes:
    SharedOutputBuffer

      public interface ContentOutputBuffer

  Generic content output buffer.
  Since:
    4.0

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `length()` Return length data stored in the buffer
    `void` | `reset()` Resets the buffer by clearing its state and stored content.
    `void` | `write(byte[] b, int off, int len)` Writes `len` bytes from the specified byte array starting at offset `off` to this buffer.
    `void` | `write(int b)` Writes the specified byte to this buffer.
    `void` | `writeCompleted()` Indicates the content has been fully written.

- - ### Method Detail

    - #### length

          int length()

      Return length data stored in the buffer
      Returns:
        data length

    - #### reset

          void reset()

      Resets the buffer by clearing its state and stored content.

    - #### write

          void write(byte[] b,
                   int off,
                   int len)
                     throws IOException

      Writes `len` bytes from the specified byte array starting at offset `off` to this buffer.

      If `off` is negative, or `len` is negative, or `off+len` is greater than the length of the array `b`, this method can throw a runtime exception. The exact type of runtime exception thrown by this method depends on implementation.

      Parameters:
        `b` - the data.
        `off` - the start offset in the data.
        `len` - the number of bytes to write.
      Throws:
        `IOException` - if an I/O error occurs.

    - #### write

          void write(int b)
                     throws IOException

      Writes the specified byte to this buffer.
      Parameters:
        `b` - the `byte`.
      Throws:
        `IOException` - if an I/O error occurs.

    - #### writeCompleted

          void writeCompleted()
                              throws IOException

      Indicates the content has been fully written.
      Throws:
        `IOException` - if an I/O error occurs.

Copyright © 2005–2022 The Apache Software Foundation. All rights reserved.