public class BufferInputStream extends java.io.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() |
java.lang.RuntimeException |
getException() |
long |
getMillisBeforeTimeout() |
long |
getMillisInterruptCheck() |
void |
handleBuffer(IBuffer buffer)
Handles an
IBuffer and possibly releases it. |
boolean |
isCCAM() |
int |
read() |
int |
read(byte[] b,
int off,
int len) |
void |
restartTimeout() |
void |
setException(RemoteException exception) |
java.lang.String |
toString() |
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 java.lang.RuntimeException getException()
public void setException(RemoteException exception)
public void handleBuffer(IBuffer buffer)
IBufferHandler
IBuffer
and possibly 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 on to some further party.
handleBuffer
in interface IBufferHandler
buffer
- The buffer to be handled.public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
protected boolean ensureBuffer() throws java.io.IOException
java.io.IOException
protected void closeChannel()
Copyright (c) 2004-2019 Eike Stepper (Loehne, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html