Package org.h2.store.fs
Class FileBaseDefault
- java.lang.Object
-
- java.nio.channels.spi.AbstractInterruptibleChannel
-
- java.nio.channels.FileChannel
-
- org.h2.store.fs.FileBase
-
- org.h2.store.fs.FileBaseDefault
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.nio.channels.ByteChannel,java.nio.channels.Channel,java.nio.channels.GatheringByteChannel,java.nio.channels.InterruptibleChannel,java.nio.channels.ReadableByteChannel,java.nio.channels.ScatteringByteChannel,java.nio.channels.SeekableByteChannel,java.nio.channels.WritableByteChannel
- Direct Known Subclasses:
FileAsync,FileEncrypt,FileMem,FileNioMapped,FileNioMem,FileSplit
public abstract class FileBaseDefault extends FileBase
Default implementation of the slow operations that need synchronization because they involve the file position.
-
-
Field Summary
Fields Modifier and Type Field Description private longposition
-
Constructor Summary
Constructors Constructor Description FileBaseDefault()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidimplTruncate(long size)The truncate implementation.longposition()java.nio.channels.FileChannelposition(long newPosition)intread(java.nio.ByteBuffer dst)java.nio.channels.FileChanneltruncate(long newLength)intwrite(java.nio.ByteBuffer src)-
Methods inherited from class org.h2.store.fs.FileBase
force, implCloseChannel, lock, map, read, read, transferFrom, transferTo, tryLock, write, write
-
Methods inherited from class java.nio.channels.FileChannel
lock, open, open, read, size, tryLock, write
-
Methods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel
begin, close, end, isOpen
-
-
-
-
Method Detail
-
position
public final long position() throws java.io.IOException- Specified by:
positionin interfacejava.nio.channels.SeekableByteChannel- Specified by:
positionin classjava.nio.channels.FileChannel- Throws:
java.io.IOException
-
position
public final java.nio.channels.FileChannel position(long newPosition) throws java.io.IOException- Specified by:
positionin interfacejava.nio.channels.SeekableByteChannel- Specified by:
positionin classjava.nio.channels.FileChannel- Throws:
java.io.IOException
-
read
public final int read(java.nio.ByteBuffer dst) throws java.io.IOException- Specified by:
readin interfacejava.nio.channels.ReadableByteChannel- Specified by:
readin interfacejava.nio.channels.SeekableByteChannel- Specified by:
readin classjava.nio.channels.FileChannel- Throws:
java.io.IOException
-
write
public final int write(java.nio.ByteBuffer src) throws java.io.IOException- Specified by:
writein interfacejava.nio.channels.SeekableByteChannel- Specified by:
writein interfacejava.nio.channels.WritableByteChannel- Specified by:
writein classjava.nio.channels.FileChannel- Throws:
java.io.IOException
-
truncate
public final java.nio.channels.FileChannel truncate(long newLength) throws java.io.IOException- Specified by:
truncatein interfacejava.nio.channels.SeekableByteChannel- Specified by:
truncatein classjava.nio.channels.FileChannel- Throws:
java.io.IOException
-
implTruncate
protected abstract void implTruncate(long size) throws java.io.IOExceptionThe truncate implementation.- Parameters:
size- the new size- Throws:
java.io.IOException- on failure
-
-