org.apache.hc.core5.http.nio

## Interface ContentDecoder

- All Known Subinterfaces:
    FileContentDecoder
  All Known Implementing Classes:
    AbstractContentDecoder, ChunkDecoder, IdentityDecoder, LengthDelimitedDecoder

      public interface ContentDecoder

  Abstract HTTP content decoder. HTTP content decoders can be used to read entity content from the underlying channel in small chunks and apply the required coding transformation.
  Since:
    4.0

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `List<? extends Header>` | `getTrailers()` Returns content trailers if available
    `boolean` | `isCompleted()` Returns `true` if the entity has been received in its entirety.
    `int` | `read(ByteBuffer dst)` Reads a portion of content from the underlying channel

- - ### Method Detail

    - #### read

          int read(ByteBuffer dst)
                   throws IOException

      Reads a portion of content from the underlying channel
      Parameters:
        `dst` - The buffer into which entity content is to be transferred
      Returns:
        The number of bytes read, possibly zero, or -1 if the channel has reached end-of-stream
      Throws:
        `IOException` - if I/O error occurs while reading content

    - #### isCompleted

          boolean isCompleted()

      Returns `true` if the entity has been received in its entirety.
      Returns:
        `true` if all the content has been consumed, `false` otherwise.

    - #### getTrailers

          List<? extends Header> getTrailers()

      Returns content trailers if available
      Returns:
        list of trailers
      Since:
        5.0

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