public class RepeatableInputStream extends InputStream
Note: Always use a RepeatableFileInputStream instead of this
class if you are sourcing data from a file, as the file-based repeatable
input stream can be repeated without any limitations.
| 构造器和说明 |
|---|
RepeatableInputStream(InputStream inputStream,
int bufferSize)
Creates a repeatable input stream based on another input stream.
|
| 限定符和类型 | 方法和说明 |
|---|---|
int |
available() |
void |
close() |
InputStream |
getWrappedInputStream() |
void |
mark(int readlimit)
This method can only be used while less data has been read from the input
stream than fits into the buffer.
|
boolean |
markSupported() |
int |
read() |
int |
read(byte[] out,
int outOffset,
int outLength) |
void |
reset()
Resets the input stream to the beginning by pointing the buffer offset to
the beginning of the available data buffer.
|
read, skippublic RepeatableInputStream(InputStream inputStream, int bufferSize)
inputStream - The input stream to wrap. The data read from the wrapped input
stream is buffered as it is read, up to the buffer limit
specified.bufferSize - The number of bytes buffered by this class.public void reset()
throws IOException
reset 在类中 InputStreamIOException - When the available buffer size has been exceeded, in which
case the input stream data cannot be repeated.public boolean markSupported()
markSupported 在类中 InputStreamInputStream.markSupported()public void mark(int readlimit)
mark 在类中 InputStreampublic int available()
throws IOException
available 在类中 InputStreamIOExceptionInputStream.available()public void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableclose 在类中 InputStreamIOExceptionInputStream.close()public int read(byte[] out,
int outOffset,
int outLength)
throws IOException
read 在类中 InputStreamIOExceptionInputStream.read(byte[], int, int)public int read()
throws IOException
read 在类中 InputStreamIOExceptionInputStream.read()public InputStream getWrappedInputStream()
Copyright © 2016. All rights reserved.