Class 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 Detail

      • seekable

        protected org.apache.hadoop.fs.Seekable seekable
    • 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 interface SeekableDecorator
        Returns:
        The underlying seekable.