class CoreIO extends Object
Copyright: Copyright 2003-2014, Knowledge Science Group, University of Calgary. Permission to use, copy, modify, distribute and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. The Knowledge Science Group makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
Constructor and Description |
---|
CoreIO() |
Modifier and Type | Method and Description |
---|---|
protected static FilePosition |
appendBlock(CASAFileBlock block,
CASAFile file) |
protected static long |
appendBlock(CASAFileBlock block,
RandomAccessFile file) |
protected static void |
clearBlocks(FilePosition pos)
go through all blocks (including first) and set free data size == total data area
|
protected static FilePosition |
getFilePosition(CASAFile file,
NodePosition nodePos)
convert the supplied node position into a file position
returns null if node not found
|
protected static FilePosition |
getFirstWritePosition(CASAFile file,
long offset,
int mode) |
protected static long |
getNodeLength(CASAFile file,
String nodeName) |
protected static long |
getNodeLength(FilePosition pos) |
protected static int |
read(FilePosition pos,
byte[] bytes,
int start,
int byteCount) |
protected static int |
read(FilePosition pos,
byte[] bytes,
int start,
int byteCount,
RandomAccessFile file)
read an arbitrary number of bytes from file
|
protected static CASAFileBlock |
readBlock(CASAFile file,
long offset) |
protected static CASAFileBlock |
readBlock(FilePosition pos) |
protected static CASAFileBlock |
readBlock(FilePosition pos,
RandomAccessFile aFile) |
protected static CASAFileBlockHeader |
readBlockHeader(CASAFile file,
long offset) |
protected static CASAFileBlockHeader |
readBlockHeader(FilePosition pos) |
protected static CASAFileBlockHeader |
readBlockHeader(FilePosition pos,
RandomAccessFile aFile) |
protected static CASAFileBlockHeader |
readBlockHeader(long offset,
RandomAccessFile aFile) |
protected static CASAFileHeader |
readFileHeader(CASAFile file) |
protected static CASAFileHeader |
readFileHeader(RandomAccessFile file) |
protected static void |
setIndexOffset(FilePosition pos,
long indexOffset)
convenience method to set the index offset in one (or more) block headers
this method follows all next links and ensures that the index offset is
consistent accross all blocks containing a node
|
protected static FilePosition |
write(FilePosition pos,
byte[] bytes)
Writes the specified data to the file for the specified node.
|
protected static FilePosition |
write(FilePosition pos,
byte[] bytes,
int startIndex,
int dataCount) |
protected static FilePosition |
write(FilePosition pos,
byte[] bytes,
int startIndex,
int dataCount,
RandomAccessFile aFile) |
protected static FilePosition |
writeBlock(CASAFileBlock block,
FilePosition pos) |
protected static FilePosition |
writeBlock(CASAFileBlock block,
FilePosition pos,
RandomAccessFile aFile) |
protected static void |
writeBlockHeader(CASAFileBlockHeader header,
FilePosition pos) |
protected static void |
writeBlockHeader(CASAFileBlockHeader header,
long offset,
RandomAccessFile file) |
protected static FilePosition write(FilePosition pos, byte[] bytes) throws IOException, CASAIOException
IOException
CASAIOException
protected static FilePosition write(FilePosition pos, byte[] bytes, int startIndex, int dataCount) throws IOException, CASAIOException
IOException
CASAIOException
protected static FilePosition write(FilePosition pos, byte[] bytes, int startIndex, int dataCount, RandomAccessFile aFile) throws IOException, CASAIOException
IOException
CASAIOException
protected static void clearBlocks(FilePosition pos) throws IOException, CASAIOException
IOException
CASAIOException
protected static FilePosition getFilePosition(CASAFile file, NodePosition nodePos) throws CASAIOException, IOException
CASAIOException
IOException
protected static FilePosition getFirstWritePosition(CASAFile file, long offset, int mode) throws CASAIOException, IOException
CASAIOException
IOException
protected static FilePosition writeBlock(CASAFileBlock block, FilePosition pos) throws IOException
IOException
protected static FilePosition writeBlock(CASAFileBlock block, FilePosition pos, RandomAccessFile aFile) throws IOException
IOException
protected static void writeBlockHeader(CASAFileBlockHeader header, FilePosition pos) throws IOException
IOException
protected static void writeBlockHeader(CASAFileBlockHeader header, long offset, RandomAccessFile file) throws IOException
IOException
protected static FilePosition appendBlock(CASAFileBlock block, CASAFile file) throws IOException, CASAIOException
IOException
CASAIOException
protected static long appendBlock(CASAFileBlock block, RandomAccessFile file) throws IOException
IOException
protected static CASAFileHeader readFileHeader(CASAFile file) throws IOException, CASAIOException
IOException
CASAIOException
protected static CASAFileHeader readFileHeader(RandomAccessFile file) throws IOException, CASAIOException
IOException
CASAIOException
protected static CASAFileBlockHeader readBlockHeader(CASAFile file, long offset) throws IOException, CASAIOException
IOException
CASAIOException
protected static CASAFileBlockHeader readBlockHeader(FilePosition pos) throws IOException, CASAIOException
IOException
CASAIOException
protected static CASAFileBlockHeader readBlockHeader(FilePosition pos, RandomAccessFile aFile) throws IOException, CASAIOException
IOException
CASAIOException
protected static CASAFileBlockHeader readBlockHeader(long offset, RandomAccessFile aFile) throws IOException, CASAIOException
IOException
CASAIOException
protected static CASAFileBlock readBlock(CASAFile file, long offset) throws IOException, CASAIOException
IOException
CASAIOException
protected static CASAFileBlock readBlock(FilePosition pos) throws IOException, CASAIOException
IOException
CASAIOException
protected static CASAFileBlock readBlock(FilePosition pos, RandomAccessFile aFile) throws IOException, CASAIOException
IOException
CASAIOException
protected static int read(FilePosition pos, byte[] bytes, int start, int byteCount) throws IOException, CASAIOException
IOException
CASAIOException
protected static int read(FilePosition pos, byte[] bytes, int start, int byteCount, RandomAccessFile file) throws IOException, CASAIOException
IOException
CASAIOException
protected static long getNodeLength(CASAFile file, String nodeName) throws CASAIOException, IOException
CASAIOException
IOException
protected static long getNodeLength(FilePosition pos) throws CASAIOException, IOException
CASAIOException
IOException
protected static void setIndexOffset(FilePosition pos, long indexOffset) throws CASAIOException, IOException
CASAIOException
IOException