Class SafeSeekInputStream
java.lang.Object
java.io.InputStream
org.archive.io.SeekInputStream
org.archive.io.SafeSeekInputStream
- All Implemented Interfaces:
RepositionableStream,Closeable,AutoCloseable
Enables multiple concurrent streams based on the same underlying stream.
- Author:
- pjack
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.archive.io.SeekInputStream
mark, markSupported, resetMethods inherited from class java.io.InputStream
available, close
-
Constructor Details
-
SafeSeekInputStream
Constructor. The given stream will be positioned to 0 so that an accurate position can be tracked.- Parameters:
input- the underlying input stream- Throws:
IOException- if an IO error occurs
-
-
Method Details
-
read
- Specified by:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
read
- Overrides:
readin classInputStream- Throws:
IOException
-
skip
- Overrides:
skipin classInputStream- Throws:
IOException
-
position
Description copied from interface:RepositionableStreamSets the current stream position.- Parameters:
p- the new stream position.- Throws:
IOException
-
position
Description copied from interface:RepositionableStreamReturns the current stream position.- Returns:
- the current stream position.
- Throws:
IOException
-