public class

IdentityInputStream

extends InputStream
java.lang.Object
   ↳ java.io.InputStream
     ↳ org.apache.http.impl.io.IdentityInputStream

Class Overview

A stream for reading from a session input buffer.

Summary

Public Constructors
IdentityInputStream(SessionInputBuffer in)
Public Methods
int available()
Returns the number of bytes that are available before this stream will block.
void close()
Closes this stream.
int read(byte[] b, int off, int len)
Reads at most length bytes from this stream and stores them in the byte array b starting at offset.
int read()
Reads a single byte from this stream and returns it as an integer in the range from 0 to 255.
[Expand]
Inherited Methods
From class java.io.InputStream
From class java.lang.Object
From interface java.io.Closeable

Public Constructors

public IdentityInputStream (SessionInputBuffer in)

Since: API Level 1

Public Methods

public int available ()

Since: API Level 1

Returns the number of bytes that are available before this stream will block. This implementation always returns 0. Subclasses should override and indicate the correct number of bytes available.

Returns
  • the number of bytes available before blocking.
Throws
IOException

public void close ()

Since: API Level 1

Closes this stream. 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)

Since: API Level 1

Reads at most length bytes from this stream and stores them in the byte array b starting at offset.

Parameters
b the byte array in which to store the bytes read.
off the initial position in buffer to store the bytes read from this stream.
len the maximum number of bytes to store in b.
Returns
  • the number of bytes actually read or -1 if the end of the stream has been reached.
Throws
IOException

public int read ()

Since: API Level 1

Reads a single byte from this stream and returns it as an integer in the range from 0 to 255. Returns -1 if the end of the stream has been reached. Blocks until one byte has been read, the end of the source stream is detected or an exception is thrown.

Returns
  • the byte read or -1 if the end of stream has been reached.
Throws
IOException