? CircularBufferInputStream
java.lang.Object
java.io.InputStream
org.apache.commons.io.input.buffer.CircularBufferInputStream
- ????????:
Closeable
,AutoCloseable
- ??????:
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.-
????
????????????protected final CircularByteBuffer
Internal buffer.protected final int
Internal buffer size.protected final InputStream
What we are streaming, used to fill the internal buffer. -
?????
????????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. -
????
??????????void
close()
protected void
Fills the buffer with the contents of the input stream.protected boolean
haveBytes
(int count) Fills the buffer from the input stream until the given number of bytes have been added to the buffer.int
read()
int
read
(byte[] buffer) int
read
(byte[] targetBuffer, int offset, int length) ??????? java.io.InputStream
available, mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skip, skipNBytes, transferTo
-
??????
-
in
What we are streaming, used to fill the internal buffer. -
buffer
Internal buffer. -
bufferSize
Internal buffer size.
-
-
???????
-
CircularBufferInputStream
Creates a new instance, which filters the given input stream, and uses the given buffer size.- ??:
inputStream
- The input stream, which is being buffered.bufferSize
- The size of theCircularByteBuffer
, which is used internally.
-
CircularBufferInputStream
Creates a new instance, which filters the given input stream, and uses a reasonable default buffer size (IOUtils.DEFAULT_BUFFER_SIZE
).- ??:
inputStream
- The input stream, which is being buffered.
-
-
??????
-
fillBuffer
Fills the buffer with the contents of the input stream.- ??:
IOException
- in case of an error while reading from the input stream.
-
haveBytes
Fills the buffer from the input stream until the given number of bytes have been added to the buffer.- ??:
count
- number of byte to fill into the buffer- ??:
- true if the buffer has bytes
- ??:
IOException
- in case of an error while reading from the input stream.
-
read
- ???:
read
???InputStream
- ??:
IOException
-
read
- ??:
read
???InputStream
- ??:
IOException
-
read
- ??:
read
???InputStream
- ??:
IOException
-
close
- ???:
close
????AutoCloseable
- ???:
close
????Closeable
- ??:
close
???InputStream
- ??:
IOException
-