Class AbstractContentDecoder

java.lang.Object
org.apache.http.impl.nio.codecs.AbstractContentDecoder
All Implemented Interfaces:
ContentDecoder
Direct Known Subclasses:
ChunkDecoder, IdentityDecoder, LengthDelimitedDecoder

public abstract class AbstractContentDecoder extends Object implements ContentDecoder
Abstract ContentDecoder that serves as a base for all content decoder implementations.
Since:
4.0
  • Constructor Details

    • AbstractContentDecoder

      public AbstractContentDecoder(ReadableByteChannel channel, SessionInputBuffer buffer, HttpTransportMetricsImpl metrics)
      Creates an instance of this class.
      Parameters:
      channel - the source channel.
      buffer - the session input buffer that can be used to store session data for intermediate processing.
      metrics - Transport metrics of the underlying HTTP transport.
  • Method Details

    • isCompleted

      public boolean isCompleted()
      Description copied from interface: ContentDecoder
      Returns true if the entity has been received in its entirety.
      Specified by:
      isCompleted in interface ContentDecoder
      Returns:
      true if all the content has been consumed, false otherwise.
    • setCompleted

      public void setCompleted(boolean completed)
      Sets the completed status of this decoder. Normally this is not necessary (the decoder will automatically complete when the underlying channel returns EOF). It is useful to mark the decoder as completed if you have some other means to know all the necessary data has been read and want to reuse the underlying connection for more messages.
      Parameters:
      completed - the completed status of this decoder.
      Since:
      4.4.11