@NotThreadSafe public final class ByteArrayDataProvider extends java.lang.Object implements ByteProvider
ByteProvider
. The underlying input
sequence of bytes is sourced from an array of bytes. While this implementation could be enhanced to make it thread-safe, it is
difficult to envision an application scenario where an input stream could be shared meaningfully among multiple callersConstructor and Description |
---|
ByteArrayDataProvider(byte[] bytes)
Instantiates a new MXF byte array data provider.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getBytes(int totalNumBytesToRead)
Getter for the raw bytes from the byte[] that this data provider encapsulates
|
void |
skipBytes(long totalNumBytesToSkip)
A method that lets the caller skip bytes in the encapsulated byte[]
|
public ByteArrayDataProvider(byte[] bytes)
bytes
- the input streampublic byte[] getBytes(int totalNumBytesToRead) throws java.io.IOException
getBytes
in interface ByteProvider
totalNumBytesToRead
- the total num bytes to readjava.io.IOException
- the iO exceptionpublic void skipBytes(long totalNumBytesToSkip) throws java.io.IOException
skipBytes
in interface ByteProvider
totalNumBytesToSkip
- the total num bytes to skip from the current positionjava.io.IOException
- the iO exception