org.hsqldb
Class ReverseDatabaseFile

java.lang.Object
java.io.RandomAccessFile
org.hsqldb.DatabaseFile
org.hsqldb.ReverseDatabaseFile
- All Implemented Interfaces:
- java.io.DataInput, java.io.DataOutput
- class ReverseDatabaseFile
- extends DatabaseFile
Cache class declaration
The cache class implements the handling of reversed text table caches.
- Version:
- 1.7.0
|
Field Summary |
protected int |
count
|
protected byte[] |
in
|
protected int |
index
|
private long |
max
|
protected long |
pos
|
private int |
size
|
|
Method Summary |
void |
close()
This method closes the file and frees up all file related system
resources. |
long |
getFilePointer()
This method returns the current offset in the file at which the next
read or write will occur |
int |
read()
This method reads a single byte of data from the file and returns it
as an integer. |
int |
read(byte[] b)
This method reads bytes from the file into the specified array. |
int |
readInteger()
|
void |
readSeek(long newPos)
|
protected void |
realSeek(long newPos)
|
void |
seek(long newPos)
This method sets the current file position to the specified offset
from the beginning of the file. |
void |
write(byte[] b)
This method writes all the bytes in the specified array to the file. |
void |
writeInteger(int i)
|
| Methods inherited from class java.io.RandomAccessFile |
getChannel, getFD, length, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, setLength, skipBytes, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
size
private int size
max
private long max
in
protected byte[] in
pos
protected long pos
index
protected int index
count
protected int count
ReverseDatabaseFile
ReverseDatabaseFile(java.lang.String name,
java.lang.String mode,
int inSize)
throws java.io.FileNotFoundException,
java.io.IOException
readSeek
public void readSeek(long newPos)
throws java.io.IOException
- Overrides:
readSeek in class DatabaseFile
read
public int read()
throws java.io.IOException
- Description copied from class:
java.io.RandomAccessFile
- This method reads a single byte of data from the file and returns it
as an integer.
- Overrides:
read in class DatabaseFile
readInteger
public int readInteger()
throws java.io.IOException
- Overrides:
readInteger in class DatabaseFile
getFilePointer
public long getFilePointer()
throws java.io.IOException
- Description copied from class:
java.io.RandomAccessFile
- This method returns the current offset in the file at which the next
read or write will occur
realSeek
protected void realSeek(long newPos)
throws java.io.IOException
seek
public void seek(long newPos)
throws java.io.IOException
- Description copied from class:
java.io.RandomAccessFile
- This method sets the current file position to the specified offset
from the beginning of the file. Note that some operating systems will
allow the file pointer to be set past the current end of the file.
read
public int read(byte[] b)
throws java.io.IOException
- Description copied from class:
java.io.RandomAccessFile
- This method reads bytes from the file into the specified array. The
bytes are stored starting at the beginning of the array and up to
buf.length bytes can be read.
write
public void write(byte[] b)
throws java.io.IOException
- Description copied from class:
java.io.RandomAccessFile
- This method writes all the bytes in the specified array to the file.
The file must be open read-write in order for this operation to succeed.
writeInteger
public void writeInteger(int i)
throws java.io.IOException
close
public void close()
throws java.io.IOException
- Description copied from class:
java.io.RandomAccessFile
- This method closes the file and frees up all file related system
resources. Since most operating systems put a limit on how many files
may be opened at any given time, it is a good idea to close all files
when no longer needed to avoid hitting this limit