org.hsqldb.persist
Class RAFileHybrid
- java.lang.Object
-
- org.hsqldb.persist.RAFileHybrid
-
- All Implemented Interfaces:
- RandomAccessInterface
public final class RAFileHybrid extends java.lang.Object implements RandomAccessInterface
Mixe NIO / non-NIO version of ScaledRAFile. This class is used only for storing a CACHED TABLE .data file and cannot be used for TEXT TABLE source files. Due to various issues with java.nio classes, this class will use a mapped channel of fixed size. After reaching this size, the file and channel are closed and a new one opened, up to the maximum size.- Since:
- 1.7.2
-
-
Constructor Summary
Constructors Constructor and Description RAFileHybrid(Database database, java.lang.String name, boolean readOnly)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclose()booleanensureLength(long newLength)DatabasegetDatabase()longgetFilePointer()booleanisReadOnly()longlength()intread()voidread(byte[] b, int offset, int length)intreadInt()longreadLong()voidseek(long position)booleansetLength(long newLength)voidsynch()voidwrite(byte[] b, int offset, int length)voidwriteInt(int i)voidwriteLong(long i)
-
-
-
Constructor Detail
-
RAFileHybrid
public RAFileHybrid(Database database, java.lang.String name, boolean readOnly) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
length
public long length() throws java.io.IOException- Specified by:
lengthin interfaceRandomAccessInterface- Throws:
java.io.IOException
-
seek
public void seek(long position) throws java.io.IOException- Specified by:
seekin interfaceRandomAccessInterface- Throws:
java.io.IOException
-
getFilePointer
public long getFilePointer() throws java.io.IOException- Specified by:
getFilePointerin interfaceRandomAccessInterface- Throws:
java.io.IOException
-
read
public int read() throws java.io.IOException- Specified by:
readin interfaceRandomAccessInterface- Throws:
java.io.IOException
-
read
public void read(byte[] b, int offset, int length) throws java.io.IOException- Specified by:
readin interfaceRandomAccessInterface- Throws:
java.io.IOException
-
write
public void write(byte[] b, int offset, int length) throws java.io.IOException- Specified by:
writein interfaceRandomAccessInterface- Throws:
java.io.IOException
-
readInt
public int readInt() throws java.io.IOException- Specified by:
readIntin interfaceRandomAccessInterface- Throws:
java.io.IOException
-
writeInt
public void writeInt(int i) throws java.io.IOException- Specified by:
writeIntin interfaceRandomAccessInterface- Throws:
java.io.IOException
-
readLong
public long readLong() throws java.io.IOException- Specified by:
readLongin interfaceRandomAccessInterface- Throws:
java.io.IOException
-
writeLong
public void writeLong(long i) throws java.io.IOException- Specified by:
writeLongin interfaceRandomAccessInterface- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfaceRandomAccessInterface- Throws:
java.io.IOException
-
isReadOnly
public boolean isReadOnly()
- Specified by:
isReadOnlyin interfaceRandomAccessInterface
-
ensureLength
public boolean ensureLength(long newLength)
- Specified by:
ensureLengthin interfaceRandomAccessInterface
-
setLength
public boolean setLength(long newLength)
- Specified by:
setLengthin interfaceRandomAccessInterface
-
getDatabase
public Database getDatabase()
-
synch
public void synch()
- Specified by:
synchin interfaceRandomAccessInterface
-
-
DataMelt 3.0 © DataMelt by jWork.ORG