Build 1.0_r1(from source)

org.apache.http.impl.io
Class IdentityInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.apache.http.impl.io.IdentityInputStream
All Implemented Interfaces:
Closeable

public class IdentityInputStream
extends InputStream

A stream for reading from a session input buffer.

Since:
4.0

Constructor Summary
IdentityInputStream(SessionInputBuffer in)
           
 
Method Summary
 int available()
          Returns a int representing then number of bytes that are available before this InputStream will block.
 void close()
          Close the InputStream.
 int read()
          Reads a single byte from this InputStream and returns the result as an int.
 int read(byte[] b, int off, int len)
          Reads at most length bytes from the Stream and stores them in byte array b starting at offset.
 
Methods inherited from class java.io.InputStream
mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdentityInputStream

public IdentityInputStream(SessionInputBuffer in)
Method Detail

available

public int available()
              throws IOException
Description copied from class: InputStream
Returns a int representing then number of bytes that are available before this InputStream will block. This method always returns 0. Subclasses should override and indicate the correct number of bytes available.

Overrides:
available in class InputStream
Returns:
the number of bytes available before blocking.
Throws:
IOException - If an error occurs in this InputStream.

close

public void close()
           throws IOException
Description copied from class: InputStream
Close the InputStream. Concrete implementations of this class should free any resources during close. This implementation does nothing.

Specified by:
close in interface Closeable
Overrides:
close in class InputStream
Throws:
IOException - If an error occurs attempting to close this InputStream.

read

public int read()
         throws IOException
Description copied from class: InputStream
Reads a single byte from this InputStream and returns the result as an int. The low-order byte is returned or -1 of the end of stream was encountered. This abstract implementation must be provided by concrete subclasses.

Specified by:
read in class InputStream
Returns:
the byte read or -1 if end of stream.
Throws:
IOException - If the stream is already closed or another IOException occurs.

read

public int read(byte[] b,
                int off,
                int len)
         throws IOException
Description copied from class: InputStream
Reads at most length bytes from the Stream and stores them in byte array b starting at offset. Answer the number of bytes actually read or -1 if no bytes were read and end of stream was encountered.

Overrides:
read in class InputStream
Parameters:
b - the byte array in which to store the read bytes.
off - the offset in b to store the read bytes.
len - the maximum number of bytes to store in b.
Returns:
the number of bytes actually read or -1 if end of stream.
Throws:
IOException - If the stream is already closed or another IOException occurs.

Build 1.0_r1(from source)

Please submit a feedback, bug or feature