public class RandomAccessDirectory
extends ucar.unidata.io.RandomAccessFile
implements ucar.nc2.util.cache.FileCacheable, java.io.Closeable
| Modifier and Type | Class and Description |
|---|---|
static class |
RandomAccessDirectory.Provider
Hook into service provider interface to RandomAccessFileProvider.
|
| Modifier and Type | Field and Description |
|---|---|
protected int |
bufferSize |
protected java.util.List<RandomAccessDirectoryItem> |
children |
allFiles, BIG_ENDIAN, bigEndian, buffer, bufferModified, bufferStart, dataEnd, dataSize, debugAccess, debugLeaks, defaultBufferSize, endOfFile, file, fileChannel, filePosition, LITTLE_ENDIAN, location, openFiles, readonly, showOpen, showRead| Constructor and Description |
|---|
RandomAccessDirectory(java.lang.String location) |
RandomAccessDirectory(java.lang.String location,
int bufferSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
RandomAccessDirectoryItem |
getFileAtPos(int pos)
Return the directory item containing the specified position
|
java.util.List<RandomAccessDirectoryItem> |
getFilesInPath(java.lang.String path)
Find all files in the store that fall under the given path
|
long |
getLastModified() |
boolean |
isDirectory() |
long |
length() |
protected int |
read_(long pos,
byte[] b,
int offset,
int len) |
long |
readToByteChannel(java.nio.channels.WritableByteChannel dest,
long offset,
long nbytes) |
protected void |
setFileToPos(long pos)
sets current RandomAccessFile to that containing pos
saves start position on current RAF
|
void |
write(int b)
Not implemented - use write methods on the leaf RandomAccessFile
e.g.
|
void |
writeBytes(byte[] b,
int off,
int len)
Not implemented - use write methods on the leaf RandomAccessFile
e.g.
|
acquire, acquire, eject, enableDefaultGlobalFileCache, flush, getAllFiles, getBufferSize, getDebugLeaks, getDebugNbytes, getDebugNseeks, getFilePointer, getGlobalFileCache, getLocation, getMaxOpenFileCount, getOpenFileCount, getOpenFiles, getRandomAccessFile, isAtEndOfFile, order, order, reacquire, read, read, read, readBoolean, readBuffer, readByte, readBytes, readBytes, readChar, readDouble, readDouble, readFloat, readFloat, readFully, readFully, readInt, readInt, readIntUnbuffered, readLine, readLine, readLong, readLong, readShort, readShort, readString, readString, readStringMax, readStringMax, readUnsignedByte, readUnsignedShort, readUTF, release, searchForward, seek, setBufferSize, setDebugAccess, setDebugLeaks, setExtendMode, setFileCache, setGlobalFileCache, setMinLength, shutdown, skipBytes, skipBytes, toString, unread, write, write, writeBoolean, writeBoolean, writeByte, writeBytes, writeBytes, writeChar, writeChar, writeChar, writeChar, writeChar, writeChar, writeChars, writeChars, writeChars, writeDouble, writeDouble, writeDouble, writeDouble, writeDouble, writeDouble, writeFloat, writeFloat, writeFloat, writeFloat, writeFloat, writeFloat, writeInt, writeInt, writeInt, writeInt, writeInt, writeInt, writeLong, writeLong, writeLong, writeLong, writeLong, writeLong, writeShort, writeShort, writeShort, writeShort, writeShort, writeShort, writeUTFprotected java.util.List<RandomAccessDirectoryItem> children
protected int bufferSize
public RandomAccessDirectory(java.lang.String location)
throws java.io.IOException
java.io.IOExceptionpublic RandomAccessDirectory(java.lang.String location,
int bufferSize)
throws java.io.IOException
java.io.IOExceptionpublic RandomAccessDirectoryItem getFileAtPos(int pos)
pos - public java.util.List<RandomAccessDirectoryItem> getFilesInPath(java.lang.String path) throws java.io.IOException
path - java.io.IOExceptionprotected void setFileToPos(long pos)
throws java.io.IOException
pos - java.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface ucar.nc2.util.cache.FileCacheableclose in class ucar.unidata.io.RandomAccessFilejava.io.IOExceptionpublic long getLastModified()
getLastModified in interface ucar.nc2.util.cache.FileCacheablegetLastModified in class ucar.unidata.io.RandomAccessFilepublic boolean isDirectory()
isDirectory in class ucar.unidata.io.RandomAccessFilepublic long length()
length in class ucar.unidata.io.RandomAccessFilepublic long readToByteChannel(java.nio.channels.WritableByteChannel dest,
long offset,
long nbytes)
throws java.io.IOException
readToByteChannel in class ucar.unidata.io.RandomAccessFilejava.io.IOExceptionprotected int read_(long pos,
byte[] b,
int offset,
int len)
throws java.io.IOException
read_ in class ucar.unidata.io.RandomAccessFilejava.io.IOExceptionpublic void write(int b)
write in interface java.io.DataOutputwrite in class ucar.unidata.io.RandomAccessFilepublic void writeBytes(byte[] b,
int off,
int len)
writeBytes in class ucar.unidata.io.RandomAccessFile