AvroFSInput (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.fs, class: AvroFSInput

Package org.apache.hadoop.fs

# Class AvroFSInput

java.lang.Object
org.apache.hadoop.fs.AvroFSInput

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

@Public @Stable public class AvroFSInput extends Object implements Closeable, org.apache.avro.file.SeekableInput
Adapts an `FSDataInputStream` to Avro's SeekableInput interface.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `AvroFSInput(FileContext fc, Path p)`
  Construct given a `FileContext` and a `Path`.
  `AvroFSInput(FSDataInputStream in, long len)`
  Construct given an `FSDataInputStream` and its length.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `long`
  `length()`
  `int`
  `read(byte[] b, int off, int len)`
  `void`
  `seek(long p)`
  `long`
  `tell()`

  ### Methods inherited from class java.lang.Object

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

- ## Constructor Details

  - ### AvroFSInput

    public AvroFSInput(FSDataInputStream in, long len)
    Construct given an `FSDataInputStream` and its length.
    Parameters:
      `in` - inputstream.
      `len` - len.

  - ### AvroFSInput

    public AvroFSInput(FileContext fc, Path p) throws IOException
    Construct given a `FileContext` and a `Path`.
    Parameters:
      `fc` - filecontext.
      `p` - the path.
    Throws:
      `IOException` - If an I/O error occurred.

- ## Method Details

  - ### length

    public long length()
    Specified by:
      `length` in interface `org.apache.avro.file.SeekableInput`

  - ### 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`