Package de.xima.fc.common.io
Class MarkableRandomAccessFileInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- de.xima.fc.common.io.MarkableRandomAccessFileInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public final class MarkableRandomAccessFileInputStream extends FilterInputStream
- Since:
- 8.3.0
- Author:
- XIMA Media GmbH
-
-
Field Summary
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
mark(int readLimit)
boolean
markSupported()
static InputStream
newMarkableInputStream(File file)
Creates a new markable input stream from the givenFile
.static InputStream
newMarkableInputStream(RandomAccessFile file)
Creates a new markable input stream from the givenRandomAccessFile
.static InputStream
newMarkableInputStream(Path file)
Creates a new markable input stream from the givenPath
.void
reset()
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Method Detail
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterInputStream
- Throws:
IOException
-
mark
public void mark(int readLimit)
- Overrides:
mark
in classFilterInputStream
-
markSupported
public boolean markSupported()
- Overrides:
markSupported
in classFilterInputStream
-
reset
public void reset() throws IOException
- Overrides:
reset
in classFilterInputStream
- Throws:
IOException
-
newMarkableInputStream
public static InputStream newMarkableInputStream(RandomAccessFile file) throws IOException
Creates a new markable input stream from the givenRandomAccessFile
.- Parameters:
file
- TheRandomAccessFile
to read from.- Returns:
- A new
InputStream
instance that is markable and seekable. - Throws:
IOException
- If an I/O error occurs.
-
newMarkableInputStream
public static InputStream newMarkableInputStream(File file) throws IOException
Creates a new markable input stream from the givenFile
.- Parameters:
file
- TheFile
to read from.- Returns:
- A new
InputStream
instance that is markable and seekable. - Throws:
IOException
- If an I/O error occurs.
-
newMarkableInputStream
public static InputStream newMarkableInputStream(Path file) throws IOException
Creates a new markable input stream from the givenPath
.- Parameters:
file
- ThePath
to read from.- Returns:
- A new
InputStream
instance that is markable and seekable. - Throws:
IOException
- If an I/O error occurs.
-
-