public interface RandomAccessData
Modifier and Type | Method and Description |
---|---|
java.io.InputStream |
getInputStream()
Returns an
InputStream that can be used to read the underlying data. |
long |
getSize()
Returns the size of the data.
|
RandomAccessData |
getSubsection(long offset,
long length)
Returns a new
RandomAccessData for a specific subsection of this data. |
byte[] |
read()
Reads all the data and returns it as a byte array.
|
byte[] |
read(long offset,
long length)
Reads the
length bytes of data starting at the given offset . |
java.io.InputStream getInputStream() throws java.io.IOException
InputStream
that can be used to read the underlying data. The
caller is responsible close the underlying stream.java.io.IOException
- if the stream cannot be openedRandomAccessData getSubsection(long offset, long length)
RandomAccessData
for a specific subsection of this data.offset
- the offset of the subsectionlength
- the length of the subsectionbyte[] read() throws java.io.IOException
java.io.IOException
- if the data cannot be readbyte[] read(long offset, long length) throws java.io.IOException
length
bytes of data starting at the given offset
.offset
- the offset from which data should be readlength
- the number of bytes to be readjava.io.IOException
- if the data cannot be readjava.lang.IndexOutOfBoundsException
- if offset is beyond the end of the file or
subsectionjava.io.EOFException
- if offset plus length is greater than the length of the file
or subsectionlong getSize()