public interface RandomAccessData
Modifier and Type | Method and Description |
---|---|
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 . |
InputStream getInputStream() throws IOException
InputStream
that can be used to read the underlying data. The
caller is responsible close the underlying stream.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 IOException
IOException
- if the data cannot be readbyte[] read(long offset, long length) throws 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 readIOException
- if the data cannot be readIndexOutOfBoundsException
- if offset is beyond the end of the file or
subsectionEOFException
- if offset plus length is greater than the length of the file
or subsectionlong getSize()
Copyright © 2020 Pivotal Software, Inc.. All rights reserved.