public class CircularBufferInputStream extends InputStream
CircularByteBuffer
. Unlike the BufferedInputStream
, this one
doesn't need to reallocate byte arrays internally.Constructor and Description |
---|
CircularBufferInputStream(InputStream inputStream)
Creates a new instance, which filters the given input stream, and
uses a reasonable default buffer size (
IOUtils.DEFAULT_BUFFER_SIZE ). |
CircularBufferInputStream(InputStream inputStream,
int bufferSize)
Creates a new instance, which filters the given input stream, and
uses the given buffer size.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
int |
read() |
int |
read(byte[] buffer) |
int |
read(byte[] targetBuffer,
int offset,
int length) |
available, mark, markSupported, reset, skip
public CircularBufferInputStream(InputStream inputStream, int bufferSize)
inputStream
- The input stream, which is being buffered.bufferSize
- The size of the CircularByteBuffer
, which is
used internally.public CircularBufferInputStream(InputStream inputStream)
IOUtils.DEFAULT_BUFFER_SIZE
).inputStream
- The input stream, which is being buffered.public int read() throws IOException
read
in class InputStream
IOException
public int read(byte[] buffer) throws IOException
read
in class InputStream
IOException
public int read(byte[] targetBuffer, int offset, int length) 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
Jas4pp 1.5 © Java Analysis Studio for Particle Physics