Class CircularBufferInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.apache.commons.io.input.buffer.CircularBufferInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Direct Known Subclasses:
PeekableInputStream
Implements a buffered input stream, which is internally based on a
CircularByteBuffer
. Unlike the
BufferedInputStream
, this one doesn't need to reallocate byte arrays internally.-
Constructor Summary
ConstructorsConstructorDescriptionCircularBufferInputStream
(InputStream inputStream) Constructs 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) Constructs a new instance, which filters the given input stream, and uses the given buffer size. -
Method Summary
Methods inherited from class java.io.FilterInputStream
available, mark, markSupported, read, reset, skip
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
CircularBufferInputStream
Constructs a new instance, which filters the given input stream, and uses a reasonable default buffer size (IOUtils.DEFAULT_BUFFER_SIZE
).- Parameters:
inputStream
- The input stream, which is being buffered.
-
CircularBufferInputStream
Constructs a new instance, which filters the given input stream, and uses the given buffer size.- Parameters:
inputStream
- The input stream, which is being buffered.bufferSize
- The size of theCircularByteBuffer
, which is used internally.
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classFilterInputStream
- Throws:
IOException
-