org.jets3t.service.io
Class RepeatableFileInputStream
java.lang.Object
java.io.InputStream
org.jets3t.service.io.RepeatableFileInputStream
- All Implemented Interfaces:
- Closeable, InputStreamWrapper
public class RepeatableFileInputStream
- extends 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.
- Author:
- James Murty
RepeatableFileInputStream
public RepeatableFileInputStream(File file)
throws FileNotFoundException
- Creates a repeatable input stream based on a file.
- Parameters:
file
-
- Throws:
FileNotFoundException
reset
public void reset()
throws 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.
- Overrides:
reset
in class InputStream
- Throws:
UnrecoverableIOException
- when the FileInputStream cannot be re-created.
IOException
markSupported
public boolean markSupported()
- Overrides:
markSupported
in class InputStream
mark
public void mark(int readlimit)
- Overrides:
mark
in class InputStream
available
public int available()
throws IOException
- Overrides:
available
in class InputStream
- Throws:
IOException
close
public void close()
throws IOException
- Specified by:
close
in interface Closeable
- Overrides:
close
in class InputStream
- Throws:
IOException
read
public int read()
throws IOException
- Specified by:
read
in class InputStream
- Throws:
IOException
read
public int read(byte[] arg0,
int arg1,
int arg2)
throws IOException
- Overrides:
read
in class InputStream
- Throws:
IOException
getWrappedInputStream
public InputStream getWrappedInputStream()
- Specified by:
getWrappedInputStream
in interface InputStreamWrapper
- Returns:
- the underlying input stream wrapped by this class.