org.apache.trevni.avro

## Class HadoopInput

- java.lang.Object
- - org.apache.trevni.avro.HadoopInput

- All Implemented Interfaces:
    Closeable, AutoCloseable, Input

      public class HadoopInput
      extends Object
      implements Input

  Adapt a Hadoop `FSDataInputStream` to Trevni's `Input`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `HadoopInput(Path path, Configuration conf)` Construct given a path and a configuration.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `long` | `length()` Return the total length of the input.
    `int` | `read(long p, byte[] b, int s, int l)` Positioned read.

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

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

- - ### Constructor Detail

    - #### HadoopInput

          public HadoopInput(Path path,
                             Configuration conf)
                      throws IOException

      Construct given a path and a configuration.
      Throws:
        `IOException`

  - ### Method Detail

    - #### length

          public long length()

      Description copied from interface: `Input`
      Return the total length of the input.
      Specified by:
        `length` in interface `Input`

    - #### read

          public int read(long p,
                          byte[] b,
                          int s,
                          int l)
                   throws IOException

      Description copied from interface: `Input`
      Positioned read.
      Specified by:
        `read` in interface `Input`
      Throws:
        `IOException`

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Throws:
        `IOException`

Copyright © 2009–2024 The Apache Software Foundation. All rights reserved.