public class RepeatableFileInputStream extends java.io.InputStream implements InputStreamWrapper
Modifier and Type | Field and Description |
---|---|
protected long |
bytesReadPastMarkPoint |
protected java.io.File |
file |
protected java.io.FileInputStream |
fis |
protected long |
markPoint |
Constructor and Description |
---|
RepeatableFileInputStream(java.io.File file)
Creates a repeatable input stream based on a file.
|
Modifier and Type | Method and Description |
---|---|
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.
|
long |
skip(long toSkip) |
protected java.io.File file
protected java.io.FileInputStream fis
protected long bytesReadPastMarkPoint
protected long markPoint
public RepeatableFileInputStream(java.io.File file) throws java.io.FileNotFoundException
file
- java.io.FileNotFoundException
public long skip(long toSkip) throws java.io.IOException
skip
in class java.io.InputStream
java.io.IOException
public void reset() throws java.io.IOException
reset
in class java.io.InputStream
UnrecoverableIOException
- when the FileInputStream cannot be re-created.java.io.IOException
public boolean markSupported()
markSupported
in class java.io.InputStream
public void mark(int readlimit)
mark
in class java.io.InputStream
public int available() throws java.io.IOException
available
in class java.io.InputStream
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
public int read() throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public int read(byte[] arg0, int arg1, int arg2) throws java.io.IOException
read
in class java.io.InputStream
java.io.IOException
public java.io.InputStream getWrappedInputStream()
getWrappedInputStream
in interface InputStreamWrapper