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

public Class SocketInputBuffer

extends AbstractSessionInputBuffer
implements EofSensor
Class Inheritance
All Implemented Interfaces
org.apache.http.io.EofSensor
Annotations
@Deprecated
Imports
java.io.IOException, java.net.Socket, org.apache.http.io.EofSensor, org.apache.http.params.HttpParams, org.apache.http.util.Args

Deprecated

(4.3) use SessionInputBufferImpl

org.apache.http.io.SessionInputBuffer implementation bound to a Socket.
Since
4.0

Field Summary

Modifier and TypeField and Description
private boolean
private final Socket

Constructor Summary

AccessConstructor and Description
public
SocketInputBuffer(final Socket
the socket to read data from.
socket
,
final int
the size of the internal buffer. If this number is less than 0 it is set to the value of Socket#getReceiveBufferSize(). If resultant number is less than 1024 it is set to 1024.
bufferSize
,
final HttpParams
HTTP parameters.
params
)

Deprecated as a consequence of HttpParams being deprecated.
Creates an instance of this class.

Method Summary

Modifier and TypeMethod and Description
protected int
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
Inherited from org.apache.http.impl.io.AbstractSessionInputBuffer:
availablecapacitycreateTransportMetricsgetMetricshasBufferedDatainitlengthreadreadreadreadLinereadLine

Field Detail

eofback to summary
private boolean eof
socketback to summary
private final Socket socket

Constructor Detail

SocketInputBufferback to summary
public SocketInputBuffer(final Socket socket, final int bufferSize, final HttpParams params) throws IOException

Deprecated

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

Creates an instance of this class.

Parameters
socket:Socket

the socket to read data from.

bufferSize:int

the size of the internal buffer. If this number is less than 0 it is set to the value of Socket#getReceiveBufferSize(). If resultant number is less than 1024 it is set to 1024.

params:HttpParams

HTTP parameters.

Method Detail

fillBufferback to summary
protected int fillBuffer() throws IOException

Overrides org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer.

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