|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface abstracts an object that implements reading and writing on a random access file. It extends DataInput and DataOutput, so it implicitly contains all the methods of those interfaces. Any method in this interface that also appears in the java.io.RandomAccessFile class should behave as the java.io.RandomAccessFile method does.
Each StorageRandomAccessFile has an associated file pointer, a byte offset in the file. All reading and writing takes place at the file pointer offset and advances it.
An implementation of StorageRandomAccessFile need not be thread safe. The database engine single-threads access to each StorageRandomAccessFile instance. Two threads will not access the same StorageRandomAccessFile instance at the same time.
Method Summary | |
void |
close()
Closes this file. |
long |
getFilePointer()
Get the current offset in this file. |
long |
length()
Gets the length of this file. |
void |
seek(long newFilePointer)
Set the file pointer. |
void |
setLength(long newLength)
Sets the length of this file, either extending or truncating it. |
void |
sync(boolean metaData)
Force any changes out to the persistent store. |
Methods inherited from interface java.io.DataInput |
readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, skipBytes |
Methods inherited from interface java.io.DataOutput |
write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF |
Method Detail |
public void close() throws java.io.IOException
java.io.IOException
- - if an I/O error occurs.public long getFilePointer() throws java.io.IOException
java.io.IOException
- - if an I/O error occurs.public long length() throws java.io.IOException
java.io.IOException
- - if an I/O error occurs.public void seek(long newFilePointer) throws java.io.IOException
newFilePointer
- the new file pointer, measured in bytes from the beginning of the file.
java.io.IOException
- - if newFilePointer is less than 0 or an I/O error occurs.public void setLength(long newLength) throws java.io.IOException
If the file is extended then the contents of the extension are not defined.
If the file is truncated and the file pointer is greater than the new length then the file pointer is set to the new length.
newLength
- The new file length.
java.io.IOException
- If an I/O error occurs.public void sync(boolean metaData) throws java.io.IOException
metaData
- If true then this method must force both changes to the file's
contents and metadata to be written to storage; if false, it need only force file content changes
to be written. The implementation is allowed to ignore this parameter and always force out
metadata changes.
SyncFailedException
- if a possibly recoverable error occurs.
java.io.IOException
- If an IO error occurs.
|
Built on Tue 2006-10-10 19:23:47+0200, from revision exported | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |