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

## Method Summary

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

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

`nullInputStream, read, readNBytes`

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

### InputBytes

public InputBytes(byte[] data)
Construct for the given bytes.

### InputBytes

public InputBytes(ByteBuffer data)
Construct for the given bytes.

## Method Details

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