Class FSDataInputStreamWrapper

java.lang.Object
org.apache.flink.formats.avro.utils.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 Details

    • FSDataInputStreamWrapper

      public FSDataInputStreamWrapper(org.apache.flink.core.fs.FSDataInputStream stream, long len)
  • Method Details

    • 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
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException