类 RandomAccessDataFile
- java.lang.Object
 - org.springframework.boot.loader.data.RandomAccessDataFile
 
- 所有已实现的接口:
 RandomAccessData
public class RandomAccessDataFile extends Object implements RandomAccessData
RandomAccessDataimplementation backed by aRandomAccessFile.
嵌套类概要
从接口继承的嵌套类/接口 org.springframework.boot.loader.data.RandomAccessData
RandomAccessData.ResourceAccess
构造器概要
构造器 构造器 说明 RandomAccessDataFile(File file)Create a newRandomAccessDataFilebacked by the specified file.RandomAccessDataFile(File file, int concurrentReads)Create a newRandomAccessDataFilebacked by the specified file.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidclose()FilegetFile()Returns the underlying File.InputStreamgetInputStream(RandomAccessData.ResourceAccess access)Returns anInputStreamthat can be used to read the underlying data.longgetSize()Returns the size of the data.RandomAccessDatagetSubsection(long offset, long length)Returns a newRandomAccessDatafor a specific subsection of this data.
构造器详细资料
RandomAccessDataFile
public RandomAccessDataFile(File file)
Create a newRandomAccessDataFilebacked by the specified file.- 参数:
 file- the underlying file- 抛出:
 IllegalArgumentException- if the file is null or does not exist- 另请参阅:
 RandomAccessDataFile(File, int)
RandomAccessDataFile
public RandomAccessDataFile(File file, int concurrentReads)
Create a newRandomAccessDataFilebacked by the specified file.- 参数:
 file- the underlying fileconcurrentReads- the maximum number of concurrent reads allowed on the underlying file before blocking- 抛出:
 IllegalArgumentException- if the file is null or does not exist- 另请参阅:
 RandomAccessDataFile(File)
方法详细资料
getInputStream
public InputStream getInputStream(RandomAccessData.ResourceAccess access) throws IOException
从接口复制的说明:RandomAccessDataReturns anInputStreamthat can be used to read the underlying data. The caller is responsible close the underlying stream.- 指定者:
 getInputStream在接口中RandomAccessData- 参数:
 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
public RandomAccessData getSubsection(long offset, long length)
从接口复制的说明:RandomAccessDataReturns a newRandomAccessDatafor a specific subsection of this data.- 指定者:
 getSubsection在接口中RandomAccessData- 参数:
 offset- the offset of the subsectionlength- the length of the subsection- 返回:
 - the subsection data
 
getSize
public long getSize()
从接口复制的说明:RandomAccessDataReturns the size of the data.- 指定者:
 getSize在接口中RandomAccessData- 返回:
 - the size
 
close
public void close() throws IOException
- 抛出:
 IOException