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 Details

    • seekable

      protected org.apache.hadoop.fs.Seekable seekable
  • Constructor Details

    • SeekableInputStream

      public SeekableInputStream(InputStream in)
    • SeekableInputStream

      public SeekableInputStream(InputStream in, org.apache.hadoop.fs.Seekable seekable)
      Constructs a new ProxyInputStream.
  • Method Details

    • 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 interface SeekableDecorator
      Returns:
      The underlying seekable.