public class ByteArrayBinaryModel extends java.lang.Object implements BinaryModel
Constructor and Description |
---|
ByteArrayBinaryModel() |
ByteArrayBinaryModel(byte[] data) |
ByteArrayBinaryModel(java.io.InputStream in) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the model and disposes all resources.
|
int |
getBytes(long offset,
int len,
byte[] target)
Gets a sequence of bytes and copies them into the supplied byte array.
|
long |
getLength()
Returns the total length of the binary data.
|
public ByteArrayBinaryModel()
public ByteArrayBinaryModel(byte[] data)
public ByteArrayBinaryModel(java.io.InputStream in) throws java.io.IOException
java.io.IOException
public long getLength()
BinaryModel
getLength
in interface BinaryModel
public int getBytes(long offset, int len, byte[] target)
getBytes
in interface BinaryModel
offset
- the starting offset >= 0len
- the number of bytes >= 0 && <= size - offsettarget
- the target array to copy intojava.lang.ArrayIndexOutOfBoundsException
- Thrown if the area covered by
the arguments is not contained in the model.public void close()
BinaryModel
close
in interface BinaryModel