Package ucar.unidata.io.zarr
Class VirtualRandomAccessFile
- java.lang.Object
-
- ucar.unidata.io.zarr.VirtualRandomAccessFile
-
- All Implemented Interfaces:
RandomAccessDirectoryItem
public class VirtualRandomAccessFile extends Object implements RandomAccessDirectoryItem
A wrapper for a RandomAccessFile that allows lazy loading
-
-
Constructor Summary
Constructors Constructor Description VirtualRandomAccessFile(String location, long startIndex, long length, long lastModified, int bufferSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getLastModified()
String
getLocation()
RandomAccessFile
getOrOpenRaf()
RandomAccessFile
getRaf()
long
length()
long
startIndex()
-
-
-
Constructor Detail
-
VirtualRandomAccessFile
public VirtualRandomAccessFile(String location, long startIndex, long length, long lastModified, int bufferSize)
-
-
Method Detail
-
getLocation
public String getLocation()
- Specified by:
getLocation
in interfaceRandomAccessDirectoryItem
- Returns:
- location of directory item
-
startIndex
public long startIndex()
- Specified by:
startIndex
in interfaceRandomAccessDirectoryItem
- Returns:
- start index of item relative to directory
-
length
public long length()
- Specified by:
length
in interfaceRandomAccessDirectoryItem
- Returns:
- size of directory item
-
getLastModified
public long getLastModified()
- Specified by:
getLastModified
in interfaceRandomAccessDirectoryItem
- Returns:
- last modified time (in ms) of directory item
-
getRaf
public RandomAccessFile getRaf()
- Specified by:
getRaf
in interfaceRandomAccessDirectoryItem
- Returns:
- RandomAccessFile for directory item or null if unopened
-
getOrOpenRaf
public RandomAccessFile getOrOpenRaf() throws IOException
- Specified by:
getOrOpenRaf
in interfaceRandomAccessDirectoryItem
- Returns:
- RandomAccessFile for directory item
- Throws:
IOException
-
-