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.FileNotFoundExceptionpublic long skip(long toSkip)
throws java.io.IOException
skip in class java.io.InputStreamjava.io.IOExceptionpublic void reset()
throws java.io.IOException
reset in class java.io.InputStreamUnrecoverableIOException - when the FileInputStream cannot be re-created.java.io.IOExceptionpublic boolean markSupported()
markSupported in class java.io.InputStreampublic void mark(int readlimit)
mark in class java.io.InputStreampublic int available()
throws java.io.IOException
available in class java.io.InputStreamjava.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.InputStreamjava.io.IOExceptionpublic int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(byte[] arg0,
int arg1,
int arg2)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic java.io.InputStream getWrappedInputStream()
getWrappedInputStream in interface InputStreamWrapper