Quadcap Embeddable Database

com.quadcap.sql.file.RandomAccess Class Reference

Inheritance diagram for com.quadcap.sql.file.RandomAccess:

com.quadcap.sql.file.BlockAccess com.quadcap.sql.file.BufferedRandomAccess com.quadcap.sql.file.ByteArrayRandomAccess com.quadcap.sql.file.FileRandomAccess List of all members.

Detailed Description

This interface is used to access a region of consecutive bytes in a random access manner.

Author:
Stan Bailes

Definition at line 50 of file RandomAccess.java.

Public Member Functions

abstract long size ()
 Return the size of the managed region.

abstract void resize (long newSize) throws IOException
 Resize the managed region.

abstract void write (long pos, byte[] buf, int offset, int len) throws IOException
abstract void read (long pos, byte[] buf, int offset, int len) throws IOException
 Read len bytes from location pos of the region into the buffer buf, starting at offset.

abstract void close () throws IOException
 Finalization...

abstract void flush () throws IOException
void writeByte (int pos, int val) throws IOException
int readByte (int pos) throws IOException
void writeInt (long pos, int val) throws IOException
 Write a integer value to the specified position in the buffer.

int readInt (long pos) throws IOException
 Write a integer value to the specified position in the buffer.

void writeLong (long pos, long val) throws IOException
 Write a long value to the specified position in the buffer.

long readLong (long pos) throws IOException
 Write a long value to the specified position in the buffer.


Package Attributes

byte[] fmtBuf = new byte[8]


Member Function Documentation

abstract void com.quadcap.sql.file.RandomAccess.close  )  throws IOException [pure virtual]
 

Finalization...

Implemented in com.quadcap.sql.file.BlockAccess, com.quadcap.sql.file.BufferedRandomAccess, com.quadcap.sql.file.ByteArrayRandomAccess, and com.quadcap.sql.file.FileRandomAccess.

Referenced by com.quadcap.sql.file.RandomAccessOutputStream.close(), com.quadcap.sql.file.RandomAccessInputStream.close(), com.quadcap.sql.file.LogBuffer.close(), and com.quadcap.sql.file.BufferedRandomAccess.close().

abstract void com.quadcap.sql.file.RandomAccess.flush  )  throws IOException [pure virtual]
 

Implemented in com.quadcap.sql.file.BlockAccess, com.quadcap.sql.file.BufferedRandomAccess, com.quadcap.sql.file.ByteArrayRandomAccess, and com.quadcap.sql.file.FileRandomAccess.

Referenced by com.quadcap.sql.file.BufferedRandomAccess.flush(), and com.quadcap.sql.file.LogBuffer.sync().

abstract void com.quadcap.sql.file.RandomAccess.read long  pos,
byte[]  buf,
int  offset,
int  len
throws IOException [pure virtual]
 

Read len bytes from location pos of the region into the buffer buf, starting at offset.

Implemented in com.quadcap.sql.file.BlockAccess, com.quadcap.sql.file.BufferedRandomAccess, com.quadcap.sql.file.ByteArrayRandomAccess, and com.quadcap.sql.file.FileRandomAccess.

Referenced by com.quadcap.sql.file.BufferedRandomAccess.getBuffer(), com.quadcap.sql.types.ValueBlob.getBytes(), com.quadcap.sql.types.ValueClob.getChars(), com.quadcap.sql.file.RandomAccessInputStream.read(), and com.quadcap.sql.file.LogBuffer.read().

int com.quadcap.sql.file.RandomAccess.readByte int  pos  )  throws IOException
 

Reimplemented in com.quadcap.sql.file.ByteArrayRandomAccess.

Definition at line 90 of file RandomAccess.java.

References com.quadcap.sql.file.RandomAccess.fmtBuf, and com.quadcap.sql.file.RandomAccess.readByte().

Referenced by com.quadcap.sql.file.RandomAccess.readByte(), and com.quadcap.sql.file.LogBuffer.readByte().

int com.quadcap.sql.file.RandomAccess.readInt long  pos  )  throws IOException
 

Write a integer value to the specified position in the buffer.

Definition at line 110 of file RandomAccess.java.

References com.quadcap.sql.file.RandomAccess.fmtBuf, and com.quadcap.sql.file.RandomAccess.readInt().

Referenced by com.quadcap.sql.file.LogBuffer.init(), and com.quadcap.sql.file.RandomAccess.readInt().

long com.quadcap.sql.file.RandomAccess.readLong long  pos  )  throws IOException
 

Write a long value to the specified position in the buffer.

Definition at line 130 of file RandomAccess.java.

References com.quadcap.sql.file.RandomAccess.fmtBuf, and com.quadcap.sql.file.RandomAccess.readLong().

Referenced by com.quadcap.sql.file.RandomAccess.readLong().

abstract void com.quadcap.sql.file.RandomAccess.resize long  newSize  )  throws IOException [pure virtual]
 

Resize the managed region.

Implemented in com.quadcap.sql.file.BlockAccess, com.quadcap.sql.file.BufferedRandomAccess, com.quadcap.sql.file.ByteArrayRandomAccess, and com.quadcap.sql.file.FileRandomAccess.

Referenced by com.quadcap.sql.file.SubPageManager.freeStream(), com.quadcap.sql.file.BlockFile.freeStream(), com.quadcap.sql.file.RandomAccessOutputStream.resize(), com.quadcap.sql.file.BufferedRandomAccess.resize(), com.quadcap.sql.types.ValueBlob.truncate(), com.quadcap.sql.file.LogBuffer.truncate(), and com.quadcap.sql.file.RandomAccessOutputStream.write().

abstract long com.quadcap.sql.file.RandomAccess.size  )  [pure virtual]
 

Return the size of the managed region.

Implemented in com.quadcap.sql.file.BlockAccess, com.quadcap.sql.file.BufferedRandomAccess, com.quadcap.sql.file.ByteArrayRandomAccess, and com.quadcap.sql.file.FileRandomAccess.

Referenced by com.quadcap.sql.file.RandomAccessInputStream.available(), com.quadcap.sql.file.BufferedRandomAccess.BufferedRandomAccess(), com.quadcap.sql.file.BufferedRandomAccess.flush(), com.quadcap.sql.file.BufferedRandomAccess.getBuffer(), com.quadcap.sql.file.Logger1.init(), com.quadcap.sql.types.ValueBlob.length(), com.quadcap.sql.file.RandomAccessInputStream.read(), com.quadcap.sql.file.RandomAccessOutputStream.size(), and com.quadcap.sql.file.RandomAccessOutputStream.write().

abstract void com.quadcap.sql.file.RandomAccess.write long  pos,
byte[]  buf,
int  offset,
int  len
throws IOException [pure virtual]
 

Implemented in com.quadcap.sql.file.BlockAccess, com.quadcap.sql.file.BufferedRandomAccess, com.quadcap.sql.file.ByteArrayRandomAccess, and com.quadcap.sql.file.FileRandomAccess.

Referenced by com.quadcap.sql.file.BufferedRandomAccess.flush(), com.quadcap.sql.types.ValueBlob.setBytes(), com.quadcap.sql.file.RandomAccessOutputStream.write(), and com.quadcap.sql.file.LogBuffer.write().

void com.quadcap.sql.file.RandomAccess.writeByte int  pos,
int  val
throws IOException
 

Reimplemented in com.quadcap.sql.file.ByteArrayRandomAccess.

Definition at line 83 of file RandomAccess.java.

References com.quadcap.sql.file.RandomAccess.fmtBuf.

Referenced by com.quadcap.sql.file.LogBuffer.writeByte().

void com.quadcap.sql.file.RandomAccess.writeInt long  pos,
int  val
throws IOException
 

Write a integer value to the specified position in the buffer.

Definition at line 100 of file RandomAccess.java.

References com.quadcap.sql.file.RandomAccess.fmtBuf, and com.quadcap.sql.file.RandomAccess.writeInt().

Referenced by com.quadcap.sql.file.LogBuffer.sync(), and com.quadcap.sql.file.RandomAccess.writeInt().

void com.quadcap.sql.file.RandomAccess.writeLong long  pos,
long  val
throws IOException
 

Write a long value to the specified position in the buffer.

Definition at line 120 of file RandomAccess.java.

References com.quadcap.sql.file.RandomAccess.fmtBuf, and com.quadcap.sql.file.RandomAccess.writeLong().

Referenced by com.quadcap.sql.file.RandomAccess.writeLong().


Member Data Documentation

byte [] com.quadcap.sql.file.RandomAccess.fmtBuf = new byte[8] [package]
 

Definition at line 51 of file RandomAccess.java.

Referenced by com.quadcap.sql.file.RandomAccess.readByte(), com.quadcap.sql.file.RandomAccess.readInt(), com.quadcap.sql.file.RandomAccess.readLong(), com.quadcap.sql.file.RandomAccess.writeByte(), com.quadcap.sql.file.RandomAccess.writeInt(), and com.quadcap.sql.file.RandomAccess.writeLong().