public class CircularBufferInputStream
extends java.io.InputStream
CircularByteBuffer. Unlike the BufferedInputStream, this one
doesn't need to reallocate byte arrays internally.| Constructor and Description |
|---|
CircularBufferInputStream(java.io.InputStream inputStream)
Creates a new instance, which filters the given input stream, and
uses a reasonable default buffer size (
IOUtils.DEFAULT_BUFFER_SIZE). |
CircularBufferInputStream(java.io.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) |
public CircularBufferInputStream(java.io.InputStream inputStream,
int bufferSize)
inputStream - The input stream, which is being buffered.bufferSize - The size of the CircularByteBuffer, which is
used internally.public CircularBufferInputStream(java.io.InputStream inputStream)
IOUtils.DEFAULT_BUFFER_SIZE).inputStream - The input stream, which is being buffered.public int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(byte[] buffer)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(byte[] targetBuffer,
int offset,
int length)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStreamjava.io.IOExceptionCopyright © 2010 - 2022 Adobe. All Rights Reserved