org.axiondb.io

Class AxionFileSystem

public class AxionFileSystem extends Object

Axion File System, creates file input/output streams and wraps then into a custom BufferedDataStream, which improves perfermance significantly.

Version: $Revision: 1.8 $ $Date: 2005/12/20 18:32:58 $

Author: Ahimanikya Satapathy

Nested Class Summary
classAxionFileSystem.PidxList
Constructor Summary
AxionFileSystem()
Method Summary
voidcloseInputStream(InputStream in)
voidcloseOutputStream(OutputStream out)
BufferedDataOutputStreamcreateBufferedDOS(File file)
create a new file and wrap wrap the stream with BufferedDataOutputStream which improves perfermance significantly.
DataOutputStreamcreateDataOutputSteam(File file)
booleancreateNewFile(File file)
ObjectOutputStreamcreateObjectOutputSteam(File file)
AxionFileSystem.PidxListnewPidxList(int count, File file, boolean readonly)
AxionInputStreamopen(File file)
Open the file in read only mode.
AxionOutputStreamopen(File file, boolean overwrite)
Open file in append mode if overwrite is false, otherwise create new file.
AxionOutputStreamopenAppend(File file)
Open file in append mode, position will be set to the end of file.
BufferedDataInputStreamopenBufferedDIS(File file)
Open file in read only mode, position will be set to 0. seek can be used to perferm random access.
BufferedDataOutputStreamopenBufferedDOS(File file, long startPos)
Open a outputsteam and points the file pointer to a given start position in the file.
BufferedDataOutputStreamopenBufferedDOSAppend(File file, int bufferSize)
Open file in append mode, position will be set to the end of file.
DataInputStreamopenDataInputSteam(File file)
ObjectInputStreamopenObjectInputSteam(File file)
IntListparseIntFile(File file)
Reads a list of int values from a file.
AxionFileSystem.PidxListparseLongPidx(File file, boolean readOnly)
Reads a list of long values from a file.
AxionFileSystem.PidxListparseUnsignedIntPidx(File file, boolean readOnly)
voidreadAll(File file, byte[] rawdata)
voidwriteIntFile(File file, IntList list)
Writes a list of int values to a file.
voidwriteUnsignedInt(BufferedDataOutputStream out, long offset, int value)
Updates an UnsignedInt value to a file.
voidwriteUnsignedIntFile(File file, LongList list)
Writes a list of long values to a file.

Constructor Detail

AxionFileSystem

public AxionFileSystem()

Method Detail

closeInputStream

public void closeInputStream(InputStream in)

closeOutputStream

public void closeOutputStream(OutputStream out)

createBufferedDOS

public BufferedDataOutputStream createBufferedDOS(File file)
create a new file and wrap wrap the stream with BufferedDataOutputStream which improves perfermance significantly.

createDataOutputSteam

public DataOutputStream createDataOutputSteam(File file)

createNewFile

public boolean createNewFile(File file)

createObjectOutputSteam

public ObjectOutputStream createObjectOutputSteam(File file)

newPidxList

public AxionFileSystem.PidxList newPidxList(int count, File file, boolean readonly)

open

public AxionInputStream open(File file)
Open the file in read only mode.

open

public AxionOutputStream open(File file, boolean overwrite)
Open file in append mode if overwrite is false, otherwise create new file.

openAppend

public AxionOutputStream openAppend(File file)
Open file in append mode, position will be set to the end of file. Creates the file if does not exist yet.

openBufferedDIS

public BufferedDataInputStream openBufferedDIS(File file)
Open file in read only mode, position will be set to 0. seek can be used to perferm random access. This will wrap the stream with BufferedDataInputStream which improves perfermance significantly.

openBufferedDOS

public BufferedDataOutputStream openBufferedDOS(File file, long startPos)
Open a outputsteam and points the file pointer to a given start position in the file.

openBufferedDOSAppend

public BufferedDataOutputStream openBufferedDOSAppend(File file, int bufferSize)
Open file in append mode, position will be set to the end of file. Creates the file if does not exist yet. This will wrap the stream with BufferedDataOutputStream which improves perfermance significantly.

openDataInputSteam

public DataInputStream openDataInputSteam(File file)

openObjectInputSteam

public ObjectInputStream openObjectInputSteam(File file)

parseIntFile

public IntList parseIntFile(File file)
Reads a list of int values from a file.

Parameters: file the Fileto read from

parseLongPidx

public AxionFileSystem.PidxList parseLongPidx(File file, boolean readOnly)
Reads a list of long values from a file.

Parameters: file the Fileto read from

parseUnsignedIntPidx

public AxionFileSystem.PidxList parseUnsignedIntPidx(File file, boolean readOnly)

readAll

public void readAll(File file, byte[] rawdata)

writeIntFile

public void writeIntFile(File file, IntList list)
Writes a list of int values to a file.

Parameters: file the Fileto write to

writeUnsignedInt

public void writeUnsignedInt(BufferedDataOutputStream out, long offset, int value)
Updates an UnsignedInt value to a file.

Parameters: raf the Fileto append to offset the pidx file offset to write value data file pointer for a given pidx offset

writeUnsignedIntFile

public void writeUnsignedIntFile(File file, LongList list)
Writes a list of long values to a file.

Parameters: file the Fileto write to