接口 RandomAccessData
public interface RandomAccessData
Interface that provides read-only random access to some underlying data. Implementations must allow concurrent reads in a thread-safe manner.
嵌套类概要
嵌套类 修饰符和类型 接口 说明 static class
RandomAccessData.ResourceAccess
Lock modes for accessing the underlying resource.
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 InputStream
getInputStream(RandomAccessData.ResourceAccess access)
Returns anInputStream
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 newRandomAccessData
for a specific subsection of this data.
方法详细资料
getInputStream
InputStream getInputStream(RandomAccessData.ResourceAccess access) throws IOException
Returns anInputStream
that can be used to read the underlying data. The caller is responsible close the underlying stream.- 参数:
access
- hint indicating how the underlying data should be accessed- 返回:
- a new input stream that can be used to read the underlying data.
- 抛出:
IOException
- if the stream cannot be opened
getSubsection
RandomAccessData getSubsection(long offset, long length)
Returns a newRandomAccessData
for a specific subsection of this data.- 参数:
offset
- the offset of the subsectionlength
- the length of the subsection- 返回:
- the subsection data
getSize
long getSize()
Returns the size of the data.- 返回:
- the size