Package org.jets3t.service.io
Class RepeatableFileInputStream
java.lang.Object
java.io.InputStream
org.jets3t.service.io.RepeatableFileInputStream
- All Implemented Interfaces:
Closeable
,AutoCloseable
,InputStreamWrapper
- Direct Known Subclasses:
SegmentedRepeatableFileInputStream
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.
- Author:
- James Murty
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a repeatable input stream based on a file. -
Method Summary
Modifier and TypeMethodDescriptionint
void
close()
void
mark
(int readlimit) boolean
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) Methods inherited from class java.io.InputStream
nullInputStream, read, readAllBytes, readNBytes, readNBytes, skipNBytes, transferTo
-
Constructor Details
-
RepeatableFileInputStream
Creates a repeatable input stream based on a file.- Parameters:
file
-- Throws:
FileNotFoundException
-
-
Method Details
-
skip
- Overrides:
skip
in classInputStream
- Throws:
IOException
-
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.- Overrides:
reset
in classInputStream
- Throws:
UnrecoverableIOException
- when the FileInputStream cannot be re-created.IOException
-
markSupported
public boolean markSupported()- Overrides:
markSupported
in classInputStream
-
mark
public void mark(int readlimit) - Overrides:
mark
in classInputStream
-
available
- Overrides:
available
in classInputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
read
- Specified by:
read
in classInputStream
- Throws:
IOException
-
read
- Overrides:
read
in classInputStream
- Throws:
IOException
-
getWrappedInputStream
- Specified by:
getWrappedInputStream
in interfaceInputStreamWrapper
- Returns:
- the underlying input stream wrapped by this class.
-