Package org.apache.http.impl.conn
Class LoggingSessionInputBuffer
- java.lang.Object
-
- org.apache.http.impl.conn.LoggingSessionInputBuffer
-
- All Implemented Interfaces:
EofSensor
,SessionInputBuffer
@Contract(threading=IMMUTABLE) @Deprecated public class LoggingSessionInputBuffer extends java.lang.Object implements SessionInputBuffer, EofSensor
Deprecated.(4.3) no longer used.Logs all data read to the wire LOG.- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description LoggingSessionInputBuffer(SessionInputBuffer in, Wire wire)
Deprecated.LoggingSessionInputBuffer(SessionInputBuffer in, Wire wire, java.lang.String charset)
Deprecated.Create an instance that wraps the specified session input buffer.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description HttpTransportMetrics
getMetrics()
Deprecated.ReturnsHttpTransportMetrics
for this session buffer.boolean
isDataAvailable(int timeout)
Deprecated.Blocks until some data becomes available in the session buffer or the given timeout period in milliseconds elapses.boolean
isEof()
Deprecated.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 arrayb
.int
read(byte[] b, int off, int len)
Deprecated.Reads up tolen
bytes of data from the session buffer into an array of bytes.java.lang.String
readLine()
Deprecated.Reads a complete line of characters up to a line delimiter from this session buffer.int
readLine(CharArrayBuffer buffer)
Deprecated.Reads a complete line of characters up to a line delimiter from this session buffer into the given line buffer.
-
-
-
Constructor Detail
-
LoggingSessionInputBuffer
public LoggingSessionInputBuffer(SessionInputBuffer in, Wire wire, java.lang.String charset)
Deprecated.Create an instance that wraps the specified session input buffer.- Parameters:
in
- The session input buffer.wire
- The wire log to use.charset
- protocol charset,ASCII
ifnull
-
LoggingSessionInputBuffer
public LoggingSessionInputBuffer(SessionInputBuffer in, Wire wire)
Deprecated.
-
-
Method Detail
-
isDataAvailable
public boolean isDataAvailable(int timeout) throws java.io.IOException
Deprecated.Description copied from interface:SessionInputBuffer
Blocks until some data becomes available in the session buffer or the given timeout period in milliseconds elapses. If the timeout value is0
this method blocks indefinitely.- Specified by:
isDataAvailable
in interfaceSessionInputBuffer
- Parameters:
timeout
- in milliseconds.- Returns:
true
if some data is available in the session buffer orfalse
otherwise.- Throws:
java.io.IOException
- if an I/O error occurs.
-
read
public int read(byte[] b, int off, int len) throws java.io.IOException
Deprecated.Description copied from interface:SessionInputBuffer
Reads up tolen
bytes of data from the session buffer into an array of bytes. An attempt is made to read as many aslen
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, orlen
is negative, oroff+len
is greater than the length of the arrayb
, then anIndexOutOfBoundsException
is thrown.- Specified by:
read
in interfaceSessionInputBuffer
- Parameters:
b
- the buffer into which the data is read.off
- the start offset in arrayb
at which the data is written.len
- the maximum number of bytes to read.- Returns:
- 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. - Throws:
java.io.IOException
- if an I/O error occurs.
-
read
public int read() throws java.io.IOException
Deprecated.Description copied from interface:SessionInputBuffer
Reads the next byte of data from this session buffer. The value byte is returned as anint
in the range0
to255
. 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.- Specified by:
read
in interfaceSessionInputBuffer
- Returns:
- the next byte of data, or
-1
if the end of the stream is reached. - Throws:
java.io.IOException
- if an I/O error occurs.
-
read
public int read(byte[] b) throws java.io.IOException
Deprecated.Description copied from interface:SessionInputBuffer
Reads some number of bytes from the session buffer and stores them into the buffer arrayb
. 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.- Specified by:
read
in interfaceSessionInputBuffer
- Parameters:
b
- the buffer into which the data is read.- Returns:
- 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. - Throws:
java.io.IOException
- if an I/O error occurs.
-
readLine
public java.lang.String readLine() throws java.io.IOException
Deprecated.Description copied from interface:SessionInputBuffer
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.
- Specified by:
readLine
in interfaceSessionInputBuffer
- Returns:
- HTTP line as a string
- Throws:
java.io.IOException
- if an I/O error occurs.
-
readLine
public int readLine(CharArrayBuffer buffer) throws java.io.IOException
Deprecated.Description copied from interface:SessionInputBuffer
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.
- Specified by:
readLine
in interfaceSessionInputBuffer
- Parameters:
buffer
- the line buffer.- Returns:
- one line of characters
- Throws:
java.io.IOException
- if an I/O error occurs.
-
getMetrics
public HttpTransportMetrics getMetrics()
Deprecated.Description copied from interface:SessionInputBuffer
ReturnsHttpTransportMetrics
for this session buffer.- Specified by:
getMetrics
in interfaceSessionInputBuffer
- Returns:
- transport metrics.
-
-