Package 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
Description
`ByteBufferInputStream(List<ByteBuffer> buffers)`

## Method Summary

Modifier and Type
Method
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, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo`

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

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

## Constructor Details

### ByteBufferInputStream

public ByteBufferInputStream(List<ByteBuffer> buffers)

## Method Details

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