Package org.apache.derby.impl.io
Class DirRandomAccessFile
- java.lang.Object
-
- java.io.RandomAccessFile
-
- org.apache.derby.impl.io.DirRandomAccessFile
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.DataInput
,java.io.DataOutput
,java.lang.AutoCloseable
,StorageRandomAccessFile
class DirRandomAccessFile extends java.io.RandomAccessFile implements StorageRandomAccessFile
This class provides a disk based implementation of the StIRandomAccess File interface. It is used by the database engine to access persistent data and transaction logs under the directory (default) subsubprotocol.
-
-
Constructor Summary
Constructors Constructor Description DirRandomAccessFile(java.io.File name, java.lang.String mode)
Construct a StorageRandomAccessFileImpl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DirRandomAccessFile
clone()
Clone this file abstactionvoid
sync()
Force any changes out to the persistent store.-
Methods inherited from class java.io.RandomAccessFile
close, getChannel, getFD, getFilePointer, length, read, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, seek, setLength, skipBytes, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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
-
Methods inherited from interface org.apache.derby.io.StorageRandomAccessFile
close, getFilePointer, length, read, seek, setLength
-
-
-
-
Constructor Detail
-
DirRandomAccessFile
DirRandomAccessFile(java.io.File name, java.lang.String mode) throws java.io.FileNotFoundException
Construct a StorageRandomAccessFileImpl.- Parameters:
name
- The file name.mode
- The file open mode: "r", "rw", "rws", or "rwd". The "rws" and "rwd" modes specify that the file is to be synchronized, consistent with the java.io.RandomAccessFile class. However the StorageRandomAccessFile.sync() method will be called even if the file was opened in "rws" or "rwd" mode. If the "rws" or "rwd" modes are supported then the implementation of StorageRandomAccessFile.sync need not do anything.- Throws:
java.lang.IllegalArgumentException
- if the mode argument is not equal to one of "r", "rw".java.io.FileNotFoundException
- if the file exists but is a directory rather than a regular file, or cannot be opened or created for any other reason .
-
-
Method Detail
-
clone
public DirRandomAccessFile clone()
Clone this file abstaction- Specified by:
clone
in interfaceStorageRandomAccessFile
- Overrides:
clone
in classjava.lang.Object
-
sync
public void sync() throws java.io.IOException
Force any changes out to the persistent store.- Specified by:
sync
in interfaceStorageRandomAccessFile
- Throws:
java.io.IOException
- If an IO error occurs.
-
-