|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.InputStream
org.jets3t.service.io.RepeatableInputStream
A repeatable input stream wrapper for any input stream. This input stream relies on buffered data to repeat, and can therefore only be repeated when less data has been read than this buffer can hold.
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.
This class uses properties obtained through Jets3tProperties. For more information on
these properties please refer to
JetS3t Configuration
| Constructor Summary | |
RepeatableInputStream(java.io.InputStream inputStream)
Creates a repeatable input stream based on another input stream. |
|
RepeatableInputStream(java.io.InputStream inputStream,
int bufferSize)
Creates a repeatable input stream based on another input stream. |
|
| Method Summary | |
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. |
| Methods inherited from class java.io.InputStream |
read, skip |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public RepeatableInputStream(java.io.InputStream inputStream,
int bufferSize)
inputStream - an 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.
java.io.FileNotFoundExceptionpublic RepeatableInputStream(java.io.InputStream inputStream)
inputStream - an input stream to wrap. The data read from the wrapped input stream is buffered as it is
read, up to the buffer limit as set by the JetS3t property
s3service.stream-retry-buffer-size.
java.io.FileNotFoundException| Method Detail |
public void reset()
throws java.io.IOException
UnrecoverableIOException - when the available buffer size has been exceeded, in which case the input stream data cannot
be repeated.
java.io.IOExceptionpublic boolean markSupported()
public void mark(int readlimit)
public int available()
throws java.io.IOException
java.io.IOException
public void close()
throws java.io.IOException
java.io.IOException
public int read(byte[] out,
int outOffset,
int outLength)
throws java.io.IOException
java.io.IOException
public int read()
throws java.io.IOException
java.io.IOExceptionpublic java.io.InputStream getWrappedInputStream()
getWrappedInputStream in interface InputStreamWrapper
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||