Save This Page
Home » HttpComponents-Core-4.0.1 » org.apache.http.nio.util » [javadoc | source]
org.apache.http.nio.util
public interface: ContentInputBuffer [javadoc | source]

All Known Implementing Classes:
    SharedInputBuffer, SimpleInputBuffer

Buffer for storing content streamed out from a ContentDecoder .
Method from org.apache.http.nio.util.ContentInputBuffer Summary:
consumeContent,   read,   read,   reset
Method from org.apache.http.nio.util.ContentInputBuffer Detail:
 public int consumeContent(ContentDecoder decoder) throws IOException
    Reads content from the given ContentDecoder and stores it in this buffer.
 public int read() throws IOException
    Reads one byte from this buffer. If the buffer is empty this method can throw a runtime exception. The exact type of runtime exception thrown by this method depends on implementation. This method returns -1 if the end of content stream has been reached.
 public int read(byte[] b,
    int off,
    int len) throws IOException
    Reads up to len bytes of data from this buffer into an array of bytes. The exact number of bytes read depends how many bytes are stored in the 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. This method returns -1 if the end of content stream has been reached.

 public  void reset()
    Resets the buffer by clearing its state and stored content.