public class BufferInputStream extends InputStream implements IBufferHandler
buffer handler
that defragments the passed buffers
into a continuous byte
sequence which is exposed as an input stream
.Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_MILLIS_BEFORE_TIMEOUT |
static long |
DEFAULT_MILLIS_INTERRUPT_CHECK |
static long |
NO_TIMEOUT |
Constructor and Description |
---|
BufferInputStream() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
closeChannel()
Subclasses may override.
|
protected boolean |
ensureBuffer() |
RuntimeException |
getException() |
long |
getMillisBeforeTimeout() |
long |
getMillisInterruptCheck() |
void |
handleBuffer(IBuffer buffer)
Handles an
IBuffer and optionally releases it. |
boolean |
isCCAM() |
int |
read() |
void |
restartTimeout() |
void |
setException(RemoteException exception) |
String |
toString() |
available, mark, markSupported, read, read, reset, skip
public static final long NO_TIMEOUT
public static final long DEFAULT_MILLIS_BEFORE_TIMEOUT
public static final long DEFAULT_MILLIS_INTERRUPT_CHECK
public boolean isCCAM()
public long getMillisBeforeTimeout()
public long getMillisInterruptCheck()
public void restartTimeout()
public RuntimeException getException()
public void setException(RemoteException exception)
public void handleBuffer(IBuffer buffer)
IBufferHandler
IBuffer
and optionally releases it. The implementor of this method takes over the ownership of
the buffer. Care must be taken to properly release
the buffer if the ownership is not
explicitly passed to some further party.handleBuffer
in interface IBufferHandler
buffer
- The buffer to be handled and otionally released.public int read() throws IOException
read
in class InputStream
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class InputStream
IOException
protected boolean ensureBuffer() throws IOException
IOException
protected void closeChannel()
Copyright (c) 2011-2015 Eike Stepper (Berlin, Germany) and others.