English | Site Directory

Android - An Open Handset Alliance Project

org.apache.http.impl.io.IdentityInputStream

java.lang.Object
java.io.InputStream Closeable
org.apache.http.impl.io.IdentityInputStream

A stream for reading from a session input buffer.

Summary

Public Constructors

          IdentityInputStream(SessionInputBuffer in)

Public Methods

        int  available()
Answers a int representing then number of bytes that are available before this InputStream will block.
        void  close()
Close the InputStream.
        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.
        int  read()
Reads a single byte from this InputStream and returns the result as an int.
Methods inherited from class java.io.InputStream
Methods inherited from class java.lang.Object
Methods inherited from interface java.io.Closeable

Details

Public Constructors

public IdentityInputStream(SessionInputBuffer in)

Public Methods

public int available()

Answers 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.

Throws

IOException

public void close()

Close the InputStream. Concrete implementations of this class should free any resources during close. This implementation does nothing.

Throws

IOException

public 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. Answer the number of bytes actually read or -1 if no bytes were read and end of stream was encountered.

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.

Throws

IOException

public int read()

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.

Throws

IOException
Build m5-rc15i - 10 Jun 2008 13:54