org.apache.avro.file

## Class SeekableByteArrayInput

- java.lang.Object
- - java.io.InputStream
  - - java.io.ByteArrayInputStream
    - - org.apache.avro.file.SeekableByteArrayInput

- All Implemented Interfaces:
    Closeable, AutoCloseable, SeekableInput

      public class SeekableByteArrayInput
      extends ByteArrayInputStream
      implements SeekableInput

  A `SeekableInput` backed with data in a byte array.

- - ### Field Summary

    - ### Fields inherited from class java.io.ByteArrayInputStream

      `buf, count, mark, pos`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SeekableByteArrayInput(byte[] data)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `length()` Return the length of the file.
    `void` | `seek(long p)` Set the position for the next `read()`.
    `long` | `tell()` Return the position of the next `read()`.

    - ### Methods inherited from class java.io.ByteArrayInputStream

      `available, close, mark, markSupported, read, read, reset, skip`

    - ### Methods inherited from class java.io.InputStream

      `read`

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

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

    - ### Methods inherited from interface org.apache.avro.file.SeekableInput

      `read`

    - ### Methods inherited from interface java.io.Closeable

      `close`

- - ### Constructor Detail

    - #### SeekableByteArrayInput

          public SeekableByteArrayInput(byte[] data)

  - ### Method Detail

    - #### length

          public long length()
                      throws IOException

      Description copied from interface: `SeekableInput`
      Return the length of the file.
      Specified by:
        `length` in interface `SeekableInput`
      Throws:
        `IOException`

    - #### seek

          public void seek(long p)
                    throws IOException

      Description copied from interface: `SeekableInput`
      Set the position for the next `read()`.
      Specified by:
        `seek` in interface `SeekableInput`
      Throws:
        `IOException`

    - #### tell

          public long tell()
                    throws IOException

      Description copied from interface: `SeekableInput`
      Return the position of the next `read()`.
      Specified by:
        `tell` in interface `SeekableInput`
      Throws:
        `IOException`

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