Package net.sansa_stack.hadoop.util
Class SeekableInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- org.apache.commons.io.input.ProxyInputStream
-
- net.sansa_stack.hadoop.util.SeekableInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,SeekableDecorator
,org.apache.hadoop.fs.Seekable
public class SeekableInputStream extends org.apache.commons.io.input.ProxyInputStream implements SeekableDecorator
A basic wrapper that combines Hadoop's Seekable and InputStream into one class. Because InputStream is not an interface we have to work which such a wrapper class if we want the methods of both combined.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.hadoop.fs.Seekable
seekable
-
Fields inherited from class java.io.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description SeekableInputStream(InputStream in)
SeekableInputStream(InputStream in, org.apache.hadoop.fs.Seekable seekable)
Constructs a new ProxyInputStream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.hadoop.fs.Seekable
getSeekable()
You should not change the position of the underlying seekable directly while this input stream is in use.-
Methods inherited from class org.apache.commons.io.input.ProxyInputStream
afterRead, available, beforeRead, close, handleIOException, mark, markSupported, read, read, read, reset, skip
-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sansa_stack.hadoop.util.SeekableDecorator
getPos, seek, seekToNewSource
-
-
-
-
Constructor Detail
-
SeekableInputStream
public SeekableInputStream(InputStream in)
-
SeekableInputStream
public SeekableInputStream(InputStream in, org.apache.hadoop.fs.Seekable seekable)
Constructs a new ProxyInputStream.
-
-
Method Detail
-
getSeekable
public org.apache.hadoop.fs.Seekable getSeekable()
You should not change the position of the underlying seekable directly while this input stream is in use. Conversely, only use this class' seek methods for changing the position. Otherwise it my result in an inconsistent state.- Specified by:
getSeekable
in interfaceSeekableDecorator
- Returns:
- The underlying seekable.
-
-