org.jets3t.service.io
Class RepeatableFileInputStream
java.lang.Object
java.io.InputStream
org.jets3t.service.io.RepeatableFileInputStream
- All Implemented Interfaces:
- InputStreamWrapper
- public class RepeatableFileInputStream
- extends java.io.InputStream
- implements InputStreamWrapper
A repeatable input stream for files. This input stream can be repeated an unlimited number of
times, without any limitation on when a repeat can occur.
|
Method Summary |
int |
available()
|
void |
close()
|
java.io.InputStream |
getWrappedInputStream()
|
void |
mark(int readlimit)
|
boolean |
markSupported()
|
int |
read()
|
int |
read(byte[] arg0,
int arg1,
int arg2)
|
void |
reset()
Resets the input stream to the last mark point, or the beginning of the stream if
there is no mark point, by creating a new FileInputStream based on the
underlying file. |
| 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 |
RepeatableFileInputStream
public RepeatableFileInputStream(java.io.File file)
throws java.io.FileNotFoundException
- Creates a repeatable input stream based on a file.
- Parameters:
file -
- Throws:
java.io.FileNotFoundException
reset
public void reset()
throws java.io.IOException
- Resets the input stream to the last mark point, or the beginning of the stream if
there is no mark point, by creating a new FileInputStream based on the
underlying file.
- Throws:
UnrecoverableIOException - when the FileInputStream cannot be re-created.
java.io.IOException
markSupported
public boolean markSupported()
mark
public void mark(int readlimit)
available
public int available()
throws java.io.IOException
- Throws:
java.io.IOException
close
public void close()
throws java.io.IOException
- Throws:
java.io.IOException
read
public int read()
throws java.io.IOException
- Throws:
java.io.IOException
read
public int read(byte[] arg0,
int arg1,
int arg2)
throws java.io.IOException
- Throws:
java.io.IOException
getWrappedInputStream
public java.io.InputStream getWrappedInputStream()
- Specified by:
getWrappedInputStream in interface InputStreamWrapper
- Returns:
- the underlying input stream wrapped by this class.