Class SeekableInputStream

java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.apache.commons.io.input.ProxyInputStream
org.aksw.commons.io.hadoop.SeekableInputStream
All Implemented Interfaces:
Closeable, AutoCloseable, SeekableDecorator, HasPosition, org.apache.hadoop.fs.PositionedReadable, org.apache.hadoop.fs.Seekable

public class SeekableInputStream extends org.apache.commons.io.input.ProxyInputStream implements SeekableDecorator, HasPosition, org.apache.hadoop.fs.PositionedReadable
Combines Hadoop's Seekable and InputStream into one class.
  • Field Details

    • seekable

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

    • SeekableInputStream

      public SeekableInputStream(InputStream proxy, org.apache.hadoop.fs.Seekable seekable)
      Constructs a new ProxyInputStream.
      Parameters:
      proxy - the InputStream to delegate to
  • Method Details

    • getSeekable

      public org.apache.hadoop.fs.Seekable getSeekable()
      Specified by:
      getSeekable in interface SeekableDecorator
    • position

      public long position()
      Specified by:
      position in interface HasPosition
    • position

      public void position(long pos)
      Specified by:
      position in interface HasPosition
    • read

      public int read(long position, byte[] buffer, int offset, int length) throws IOException
      Specified by:
      read in interface org.apache.hadoop.fs.PositionedReadable
      Throws:
      IOException
    • readFully

      public void readFully(long position, byte[] buffer, int offset, int length) throws IOException
      Specified by:
      readFully in interface org.apache.hadoop.fs.PositionedReadable
      Throws:
      IOException
    • readFully

      public void readFully(long position, byte[] buffer) throws IOException
      Specified by:
      readFully in interface org.apache.hadoop.fs.PositionedReadable
      Throws:
      IOException