public class RandomFile extends Object
RandomFile implementation backed by a RandomAccessFile.| 构造器和说明 |
|---|
RandomFile(File file)
Create a new
RandomFile backed by the specified file. |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close() |
File |
getFile()
Returns the underlying File.
|
InputStream |
getInputStream() |
long |
getSize() |
RandomFile |
getSubsection(long offset,
long length) |
byte[] |
read() |
byte[] |
read(long offset,
long length) |
public RandomFile(File file)
RandomFile backed by the specified file.file - the underlying fileIllegalArgumentException - if the file is null or does not existpublic File getFile()
public InputStream getInputStream() throws IOException
IOExceptionpublic RandomFile getSubsection(long offset, long length)
public byte[] read()
throws IOException
IOExceptionpublic byte[] read(long offset,
long length)
throws IOException
IOExceptionpublic long getSize()
public void close()
throws IOException
IOExceptionCopyright © 2022. All rights reserved.