|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.http.impl.io.AbstractSessionInputBuffer
SessionInputBufferImpl
@Deprecated public abstract class AbstractSessionInputBuffer
Abstract base class for session input buffers that stream data from
an arbitrary InputStream
. This class buffers input data in
an internal byte array for optimal input performance.
readLine(CharArrayBuffer)
and readLine()
methods of this
class treat a lone LF as valid line delimiters in addition to CR-LF required
by the HTTP specification.
Constructor Summary | |
---|---|
AbstractSessionInputBuffer()
Deprecated. |
Method Summary | |
---|---|
int |
available()
Deprecated. Returns available space in the buffer. |
int |
capacity()
Deprecated. Returns total capacity of the buffer |
protected HttpTransportMetricsImpl |
createTransportMetrics()
Deprecated. |
protected int |
fillBuffer()
Deprecated. |
HttpTransportMetrics |
getMetrics()
Deprecated. Returns HttpTransportMetrics for this session buffer. |
protected boolean |
hasBufferedData()
Deprecated. |
protected void |
init(InputStream inputStream,
int bufferSize,
HttpParams params)
Deprecated. Initializes this session input buffer. |
int |
length()
Deprecated. Return length data stored in the buffer |
int |
read()
Deprecated. Reads the next byte of data from this session buffer. |
int |
read(byte[] b)
Deprecated. Reads some number of bytes from the session buffer and stores them into the buffer array b . |
int |
read(byte[] b,
int off,
int len)
Deprecated. Reads up to len bytes of data from the session buffer into
an array of bytes. |
String |
readLine()
Deprecated. Reads a complete line of characters up to a line delimiter from this session buffer. |
int |
readLine(CharArrayBuffer charbuffer)
Deprecated. Reads a complete line of characters up to a line delimiter from this session buffer into the given line buffer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.http.io.SessionInputBuffer |
---|
isDataAvailable |
Constructor Detail |
---|
public AbstractSessionInputBuffer()
Method Detail |
---|
protected void init(InputStream inputStream, int bufferSize, HttpParams params)
inputStream
- the source input stream.bufferSize
- the size of the internal buffer.params
- HTTP parameters.protected HttpTransportMetricsImpl createTransportMetrics()
public int capacity()
BufferInfo
capacity
in interface BufferInfo
public int length()
BufferInfo
length
in interface BufferInfo
public int available()
BufferInfo
available
in interface BufferInfo
protected int fillBuffer() throws IOException
IOException
protected boolean hasBufferedData()
public int read() throws IOException
SessionInputBuffer
int
in the range 0
to
255
. If no byte is available because the end of the stream
has been reached, the value -1
is returned. This method
blocks until input data is available, the end of the stream is detected,
or an exception is thrown.
read
in interface SessionInputBuffer
-1
if the end of the
stream is reached.
IOException
- if an I/O error occurs.public int read(byte[] b, int off, int len) throws IOException
SessionInputBuffer
len
bytes of data from the session buffer into
an array of bytes. An attempt is made to read as many as
len
bytes, but a smaller number may be read, possibly
zero. The number of bytes actually read is returned as an integer.
This method blocks until input data is available, end of file is detected, or an exception is thrown.
If off
is negative, or len
is negative, or
off+len
is greater than the length of the array
b
, then an IndexOutOfBoundsException
is
thrown.
read
in interface SessionInputBuffer
b
- the buffer into which the data is read.off
- the start offset in array b
at which the data is written.len
- the maximum number of bytes to read.
-1
if there is no more data because the end of
the stream has been reached.
IOException
- if an I/O error occurs.public int read(byte[] b) throws IOException
SessionInputBuffer
b
. The number of bytes actually read is
returned as an integer. This method blocks until input data is
available, end of file is detected, or an exception is thrown.
read
in interface SessionInputBuffer
b
- the buffer into which the data is read.
-1
is there is no more data because the end of
the stream has been reached.
IOException
- if an I/O error occurs.public int readLine(CharArrayBuffer charbuffer) throws IOException
-1
is returned. This method blocks until input
data is available, end of file is detected, or an exception is thrown.
This method treats a lone LF as a valid line delimiters in addition to CR-LF required by the HTTP specification.
readLine
in interface SessionInputBuffer
charbuffer
- the line buffer.
IOException
- if an I/O error occurs.public String readLine() throws IOException
SessionInputBuffer
null
is returned. This method blocks until input data is
available, end of file is detected, or an exception is thrown.
The choice of a char encoding and line delimiter sequence is up to the specific implementations of this interface.
readLine
in interface SessionInputBuffer
IOException
- if an I/O error occurs.public HttpTransportMetrics getMetrics()
SessionInputBuffer
HttpTransportMetrics
for this session buffer.
getMetrics
in interface SessionInputBuffer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |