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:
Closeable
,AutoCloseable
,ByteChannel
,Channel
,GatheringByteChannel
,InterruptibleChannel
,ReadableByteChannel
,ScatteringByteChannel
,SeekableByteChannel
,WritableByteChannel
- Direct Known Subclasses:
FileAsync
,FileEncrypt
,FileMem
,FileNioMapped
,FileNioMem
,FileSplit
Default implementation of the slow operations that need synchronization because they
involve the file position.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.nio.channels.FileChannel
FileChannel.MapMode
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
implTruncate
(long size) The truncate implementation.final long
position()
final FileChannel
position
(long newPosition) final int
read
(ByteBuffer dst) final FileChannel
truncate
(long newLength) final int
write
(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, map, open, open, read, size, tryLock, write
Methods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel
begin, close, end, isOpen
-
Field Details
-
position
private long position
-
-
Constructor Details
-
FileBaseDefault
public FileBaseDefault()
-
-
Method Details
-
position
- Specified by:
position
in interfaceSeekableByteChannel
- Specified by:
position
in classFileChannel
- Throws:
IOException
-
position
- Specified by:
position
in interfaceSeekableByteChannel
- Specified by:
position
in classFileChannel
- Throws:
IOException
-
read
- Specified by:
read
in interfaceReadableByteChannel
- Specified by:
read
in interfaceSeekableByteChannel
- Specified by:
read
in classFileChannel
- Throws:
IOException
-
write
- Specified by:
write
in interfaceSeekableByteChannel
- Specified by:
write
in interfaceWritableByteChannel
- Specified by:
write
in classFileChannel
- Throws:
IOException
-
truncate
- Specified by:
truncate
in interfaceSeekableByteChannel
- Specified by:
truncate
in classFileChannel
- Throws:
IOException
-
implTruncate
The truncate implementation.- Parameters:
size
- the new size- Throws:
IOException
- on failure
-