Class FSDataInputStreamWrapper

  • All Implemented Interfaces:
    Closeable, AutoCloseable, org.apache.avro.file.SeekableInput

    public class FSDataInputStreamWrapper
    extends Object
    implements Closeable, org.apache.avro.file.SeekableInput
    Code copy pasted from org.apache.avro.mapred.FSInput (which is Apache licensed as well).

    The wrapper keeps track of the position in the data stream.

    • Constructor Detail

      • FSDataInputStreamWrapper

        public FSDataInputStreamWrapper​(FSDataInputStream stream,
                                        long len)
    • Method Detail

      • length

        public long length()
                    throws IOException
        Specified by:
        length in interface org.apache.avro.file.SeekableInput
        Throws:
        IOException
      • read

        public int read​(byte[] b,
                        int off,
                        int len)
                 throws IOException
        Specified by:
        read in interface org.apache.avro.file.SeekableInput
        Throws:
        IOException
      • seek

        public void seek​(long p)
                  throws IOException
        Specified by:
        seek in interface org.apache.avro.file.SeekableInput
        Throws:
        IOException
      • tell

        public long tell()
                  throws IOException
        Specified by:
        tell in interface org.apache.avro.file.SeekableInput
        Throws:
        IOException