ResettableInputStream
and this class will be removed
in future releases.
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.
@Deprecated public class RepeatableFileInputStream extends SdkInputStream
Modifier and Type | Field and Description |
---|---|
private long |
bytesReadPastMarkPoint
Deprecated.
|
private java.io.File |
file
Deprecated.
|
private java.io.FileInputStream |
fis
Deprecated.
|
private static org.apache.commons.logging.Log |
log
Deprecated.
|
private long |
markPoint
Deprecated.
|
Constructor and Description |
---|
RepeatableFileInputStream(java.io.File file)
Deprecated.
Creates a repeatable input stream based on a file.
|
Modifier and Type | Method and Description |
---|---|
int |
available()
Deprecated.
|
void |
close()
Deprecated.
|
java.io.File |
getFile()
Deprecated.
Returns the File this stream is reading data from.
|
java.io.InputStream |
getWrappedInputStream()
Deprecated.
Returns the underlying input stream, if any, from the subclass; or null
if there is no underlying input stream.
|
void |
mark(int readlimit)
Deprecated.
|
boolean |
markSupported()
Deprecated.
|
int |
read()
Deprecated.
|
int |
read(byte[] arg0,
int arg1,
int arg2)
Deprecated.
|
void |
reset()
Deprecated.
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 n)
Deprecated.
|
abort, abortIfNeeded, isMetricActivated, release
private static final org.apache.commons.logging.Log log
private final java.io.File file
private java.io.FileInputStream fis
private long bytesReadPastMarkPoint
private long markPoint
public RepeatableFileInputStream(java.io.File file) throws java.io.FileNotFoundException
file
- The file from which this input stream reads data.java.io.FileNotFoundException
- If the specified file doesn't exist, or can't be opened.public java.io.File getFile()
public void reset() throws java.io.IOException
reset
in class java.io.InputStream
java.io.IOException
- when the FileInputStream cannot be re-created.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 long skip(long n) throws java.io.IOException
skip
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()
SdkInputStream
getWrappedInputStream
in class SdkInputStream