public class RepeatableInputStream
extends java.io.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(java.io.InputStream inputStream,
int bufferSize)
Creates a repeatable input stream based on another input stream.
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
int |
available() |
void |
close() |
java.io.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.
|
public RepeatableInputStream(java.io.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 java.io.IOException
reset クラス内 java.io.InputStreamjava.io.IOException - When the available buffer size has been exceeded, in which
case the input stream data cannot be repeated.public boolean markSupported()
markSupported クラス内 java.io.InputStreamInputStream.markSupported()public void mark(int readlimit)
mark クラス内 java.io.InputStreampublic int available()
throws java.io.IOException
available クラス内 java.io.InputStreamjava.io.IOExceptionInputStream.available()public void close()
throws java.io.IOException
close インタフェース内 java.io.Closeableclose インタフェース内 java.lang.AutoCloseableclose クラス内 java.io.InputStreamjava.io.IOExceptionInputStream.close()public int read(byte[] out,
int outOffset,
int outLength)
throws java.io.IOException
read クラス内 java.io.InputStreamjava.io.IOExceptionInputStream.read(byte[], int, int)public int read()
throws java.io.IOException
read クラス内 java.io.InputStreamjava.io.IOExceptionInputStream.read()public java.io.InputStream getWrappedInputStream()