public class ResettableFileInputStream extends FilterInputStream
A wrapper around a FileInputStream
that provides mark-and-reset capabilities.
This allows for retries on a FileInputStream
.
in
Constructor and Description |
---|
ResettableFileInputStream(FileInputStream fis)
Constructor for a file input stream that provides mark-and-reset capabilities.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
canBeWrapped(FileInputStream fis)
Return true if the provided
FileInputStream can be wrapped to provide mark-and-reset
capabilities. |
static boolean |
isAlreadyWrapped(FileInputStream fis)
Return true if the provided
FileInputStream has already been wrapped, and therefore
supports mark-and-reset capabilities. |
void |
mark(int readlimit) |
boolean |
markSupported() |
void |
reset() |
public ResettableFileInputStream(FileInputStream fis)
Constructor for a file input stream that provides mark-and-reset capabilities.
fis
- file input stream to wrapIllegalArgumentException
- if the file channel of the file input stream does not
provide a positionpublic boolean markSupported()
markSupported
in class FilterInputStream
public void mark(int readlimit)
mark
in class FilterInputStream
public void reset() throws IOException
reset
in class FilterInputStream
IOException
public static boolean canBeWrapped(FileInputStream fis)
Return true if the provided FileInputStream
can be wrapped to provide mark-and-reset
capabilities.
fis
- the FileInputStream
to checkpublic static boolean isAlreadyWrapped(FileInputStream fis)
Return true if the provided FileInputStream
has already been wrapped, and therefore
supports mark-and-reset capabilities.
fis
- the FileInputStream
to checkCopyright © 2016–2024. All rights reserved.