org.apache.trevni

## Class InputBytes

- java.lang.Object
- - java.io.InputStream
  - - java.io.ByteArrayInputStream
    - - org.apache.trevni.InputBytes

- All Implemented Interfaces:
    Closeable, AutoCloseable, Input

      public class InputBytes
      extends ByteArrayInputStream
      implements Input

  An `Input` 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
    `InputBytes(byte[] data)` Construct for the given bytes.
    `InputBytes(ByteBuffer data)` Construct for the given bytes.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `length()` Return the total length of the input.
    `int` | `read(long pos, byte[] b, int start, int len)` Positioned 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 java.io.Closeable

      `close`

- - ### Constructor Detail

    - #### InputBytes

          public InputBytes(byte[] data)

      Construct for the given bytes.

    - #### InputBytes

          public InputBytes(ByteBuffer data)

      Construct for the given bytes.

  - ### Method Detail

    - #### length

          public long length()
                      throws IOException

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

    - #### read

          public int read(long pos,
                          byte[] b,
                          int start,
                          int len)
                   throws IOException

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

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