Top Description Fields Constructors Methods
org.apache.http.impl.conn

public Class LoggingSessionInputBuffer

extends Object
implements SessionInputBuffer, EofSensor
Class Inheritance
All Implemented Interfaces
org.apache.http.io.EofSensor, org.apache.http.io.SessionInputBuffer
Annotations
@Contract
threading:IMMUTABLE
@Deprecated
Imports
java.io.IOException, org.apache.http.Consts, org.apache.http.annotation.Contract, .ThreadingBehavior, org.apache.http.io.EofSensor, .HttpTransportMetrics, .SessionInputBuffer, org.apache.http.util.CharArrayBuffer

Deprecated

(4.3) no longer used.

Logs all data read to the wire LOG.
Since
4.0

Field Summary

Modifier and TypeField and Description
private final String
private final EofSensor
eofSensor

Deprecated as a consequence of EofSensor being deprecated.
private final SessionInputBuffer
in

Original session input buffer.

private final Wire
wire

The wire log to use for writing.

Constructor Summary

AccessConstructor and Description
public
LoggingSessionInputBuffer(final SessionInputBuffer
The session input buffer.
in
,
final Wire
The wire log to use.
wire
,
final String
protocol charset, ASCII if null
charset
)

Create an instance that wraps the specified session input buffer.

public

Method Summary

Modifier and TypeMethod and Description
public HttpTransportMetrics
public boolean
isDataAvailable(final int
in milliseconds.
timeout
)

Implements org.apache.http.io.SessionInputBuffer.isDataAvailable.

Blocks until some data becomes available in the session buffer or the given timeout period in milliseconds elapses.
public boolean
public int
read(final byte[]
the buffer into which the data is read.
b
,
final int
the start offset in array b at which the data is written.
off
,
final int
the maximum number of bytes to read.
len
)

Implements org.apache.http.io.SessionInputBuffer.read.

Reads up to len bytes of data from the session buffer into an array of bytes.
public int
read()

Implements org.apache.http.io.SessionInputBuffer.read.

Reads the next byte of data from this session buffer.
public int
read(final byte[]
the buffer into which the data is read.
b
)

Implements org.apache.http.io.SessionInputBuffer.read.

Reads some number of bytes from the session buffer and stores them into the buffer array b.
public String
readLine()

Implements org.apache.http.io.SessionInputBuffer.readLine.

Reads a complete line of characters up to a line delimiter from this session buffer.
public int
readLine(final CharArrayBuffer
the line buffer.
buffer
)

Implements org.apache.http.io.SessionInputBuffer.readLine.

Reads a complete line of characters up to a line delimiter from this session buffer into the given line buffer.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

charsetback to summary
private final String charset
eofSensorback to summary
private final EofSensor eofSensor

Deprecated

as a consequence of EofSensor being deprecated. See corresponding docs for further information.

inback to summary
private final SessionInputBuffer in

Original session input buffer.

wireback to summary
private final Wire wire

The wire log to use for writing.

Constructor Detail

LoggingSessionInputBufferback to summary
public LoggingSessionInputBuffer(final SessionInputBuffer in, final Wire wire, final String charset)

Create an instance that wraps the specified session input buffer.

Parameters
in:SessionInputBuffer

The session input buffer.

wire:Wire

The wire log to use.

charset:String

protocol charset, ASCII if null

LoggingSessionInputBufferback to summary
public LoggingSessionInputBuffer(final SessionInputBuffer in, final Wire wire)

Method Detail

getMetricsback to summary
public HttpTransportMetrics getMetrics()

Implements org.apache.http.io.SessionInputBuffer.getMetrics.

Doc from org.apache.http.io.SessionInputBuffer.getMetrics.

Returns HttpTransportMetrics for this session buffer.

Returns:HttpTransportMetrics

transport metrics.

Annotations
@Override
isDataAvailableback to summary
public boolean isDataAvailable(final int timeout) throws IOException

Implements org.apache.http.io.SessionInputBuffer.isDataAvailable.

Doc from org.apache.http.io.SessionInputBuffer.isDataAvailable.

Blocks until some data becomes available in the session buffer or the given timeout period in milliseconds elapses. If the timeout value is 0 this method blocks indefinitely.

Parameters
timeout:int

in milliseconds.

Returns:boolean

true if some data is available in the session buffer or false otherwise.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
isEofback to summary
public boolean isEof()

Implements org.apache.http.io.EofSensor.isEof.

Annotations
@Override
readback to summary
public int read(final byte[] b, final int off, final int len) throws IOException

Implements org.apache.http.io.SessionInputBuffer.read.

Doc from org.apache.http.io.SessionInputBuffer.read.

Reads up to 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.

Parameters
b:byte[]

the buffer into which the data is read.

off:int

the start offset in array b at which the data is written.

len:int

the maximum number of bytes to read.

Returns:int

the total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
readback to summary
public int read() throws IOException

Implements org.apache.http.io.SessionInputBuffer.read.

Doc from org.apache.http.io.SessionInputBuffer.read.

Reads the next byte of data from this session buffer. The value byte is returned as an 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.

Returns:int

the next byte of data, or -1 if the end of the stream is reached.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
readback to summary
public int read(final byte[] b) throws IOException

Implements org.apache.http.io.SessionInputBuffer.read.

Doc from org.apache.http.io.SessionInputBuffer.read.

Reads some number of bytes from the session buffer and stores them into the buffer array 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.

Parameters
b:byte[]

the buffer into which the data is read.

Returns:int

the total number of bytes read into the buffer, or -1 is there is no more data because the end of the stream has been reached.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
readLineback to summary
public String readLine() throws IOException

Implements org.apache.http.io.SessionInputBuffer.readLine.

Doc from org.apache.http.io.SessionInputBuffer.readLine.

Reads a complete line of characters up to a line delimiter from this session buffer. The line delimiter itself is discarded. If no char is available because the end of the stream has been reached, 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.

Returns:String

HTTP line as a string

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
readLineback to summary
public int readLine(final CharArrayBuffer buffer) throws IOException

Implements org.apache.http.io.SessionInputBuffer.readLine.

Doc from org.apache.http.io.SessionInputBuffer.readLine.

Reads a complete line of characters up to a line delimiter from this session buffer into the given line buffer. The number of chars actually read is returned as an integer. The line delimiter itself is discarded. If no char is available because the end of the stream has been reached, the value -1 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.

Parameters
buffer:CharArrayBuffer

the line buffer.

Returns:int

one line of characters

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.