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, org.aksw.commons.io.input.HasPosition, org.apache.hadoop.fs.PositionedReadable, org.apache.hadoop.fs.Seekable

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

    Nested classes/interfaces inherited from class org.apache.commons.io.input.ProxyInputStream

    org.apache.commons.io.input.ProxyInputStream.AbstractBuilder<T,B extends org.apache.commons.io.build.AbstractStreamBuilder<T,B>>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.apache.hadoop.fs.Seekable
     

    Fields inherited from class java.io.FilterInputStream

    in
  • Constructor Summary

    Constructors
    Constructor
    Description
    SeekableInputStream(InputStream proxy, org.apache.hadoop.fs.Seekable seekable)
    Constructs a new ProxyInputStream.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.hadoop.fs.Seekable
     
    long
     
    void
    position(long pos)
     
    int
    read(long position, byte[] buffer, int offset, int length)
     
    void
    readFully(long position, byte[] buffer)
     
    void
    readFully(long position, byte[] buffer, int offset, int length)
     

    Methods inherited from class org.apache.commons.io.input.ProxyInputStream

    afterRead, available, beforeRead, close, handleIOException, mark, markSupported, read, read, read, reset, setReference, skip, unwrap

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.hadoop.fs.PositionedReadable

    maxReadSizeForVectorReads, minSeekForVectorReads, readVectored, readVectored

    Methods inherited from interface org.aksw.commons.io.hadoop.SeekableDecorator

    getPos, seek, seekToNewSource
  • 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 org.aksw.commons.io.input.HasPosition
    • position

      public void position(long pos)
      Specified by:
      position in interface org.aksw.commons.io.input.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