Class BufferedSeekInputStream
java.lang.Object
java.io.InputStream
org.archive.io.SeekInputStream
org.archive.io.BufferedSeekInputStream
- All Implemented Interfaces:
RepositionableStream,Closeable,AutoCloseable
Buffers data from some other SeekInputStream.
- 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
-
Constructor Details
-
BufferedSeekInputStream
Constructor.- Parameters:
input- the underlying input streamcapacity- the size of the buffer- Throws:
IOException- if an IO occurs filling the first buffer
-
-
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
Returns the stream's current position.- Returns:
- the current position
- Throws:
IOException
-
position
Seeks to the given position. This method avoids re-filling the buffer if at all possible.- Parameters:
p- the position to set- Throws:
IOException- if an IO error occurs
-
close
Close the stream, including the wrapped input stream.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-