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