Package org.h2.store.fs.async
Class FileAsync
java.lang.Object
java.nio.channels.spi.AbstractInterruptibleChannel
java.nio.channels.FileChannel
org.h2.store.fs.FileBase
org.h2.store.fs.FileBaseDefault
org.h2.store.fs.async.FileAsync
- All Implemented Interfaces:
Closeable
,AutoCloseable
,ByteChannel
,Channel
,GatheringByteChannel
,InterruptibleChannel
,ReadableByteChannel
,ScatteringByteChannel
,SeekableByteChannel
,WritableByteChannel
File which uses NIO2 AsynchronousFileChannel.
-
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 TypeMethodDescriptionprivate static <T> T
void
force
(boolean metaData) void
protected void
implTruncate
(long newLength) The truncate implementation.int
read
(ByteBuffer dst, long position) long
size()
toString()
tryLock
(long position, long size, boolean shared) int
write
(ByteBuffer src, long position) Methods inherited from class org.h2.store.fs.FileBaseDefault
position, position, read, truncate, write
Methods inherited from class org.h2.store.fs.FileBase
lock, map, read, transferFrom, transferTo, write
Methods inherited from class java.nio.channels.FileChannel
lock, map, open, open, read, tryLock, write
Methods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel
begin, close, end, isOpen
-
Field Details
-
name
-
channel
-
-
Constructor Details
-
FileAsync
FileAsync(String fileName, String mode) throws IOException - Throws:
IOException
-
-
Method Details
-
complete
- Throws:
IOException
-
implCloseChannel
- Overrides:
implCloseChannel
in classFileBase
- Throws:
IOException
-
size
- Specified by:
size
in interfaceSeekableByteChannel
- Specified by:
size
in classFileChannel
- Throws:
IOException
-
read
- Overrides:
read
in classFileBase
- Throws:
IOException
-
write
- Overrides:
write
in classFileBase
- Throws:
IOException
-
implTruncate
Description copied from class:FileBaseDefault
The truncate implementation.- Specified by:
implTruncate
in classFileBaseDefault
- Parameters:
newLength
- the new size- Throws:
IOException
- on failure
-
force
- Overrides:
force
in classFileBase
- Throws:
IOException
-
tryLock
- Overrides:
tryLock
in classFileBase
- Throws:
IOException
-
toString
-