org.apache.avro.util

## Class ByteBufferInputStream

- java.lang.Object
- - java.io.InputStream
  - - org.apache.avro.util.ByteBufferInputStream

- All Implemented Interfaces:
    Closeable, AutoCloseable

      public class ByteBufferInputStream
      extends InputStream

  Utility to present `ByteBuffer` data as an `InputStream`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ByteBufferInputStream(List<ByteBuffer> buffers)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `read()`
    `int` | `read(byte[] b, int off, int len)`
    `ByteBuffer` | `readBuffer(int length)` Read a buffer from the input without copying, if possible.

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

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

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

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

- - ### Constructor Detail

    - #### ByteBufferInputStream

          public ByteBufferInputStream(List<ByteBuffer> buffers)

  - ### Method Detail

    - #### read

          public int read()
                   throws IOException

      Specified by:
        `read` in class `InputStream`
      Throws:
        `IOException`
      See Also:
        `InputStream.read()`

    - #### read

          public int read(byte[] b,
                          int off,
                          int len)
                   throws IOException

      Overrides:
        `read` in class `InputStream`
      Throws:
        `IOException`
      See Also:
        `InputStream.read(byte[], int, int)`

    - #### readBuffer

          public ByteBuffer readBuffer(int length)
                                throws IOException

      Read a buffer from the input without copying, if possible.
      Throws:
        `IOException`

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