Package org.apache.lucene.tests.mockfile
Class FilterAsynchronousFileChannel
java.lang.Object
java.nio.channels.AsynchronousFileChannel
org.apache.lucene.tests.mockfile.FilterAsynchronousFileChannel
- All Implemented Interfaces:
Closeable
,AutoCloseable
,AsynchronousChannel
,Channel
A
FilterAsynchronousFileChannel
contains another AsynchronousFileChannel
, which
it uses as its basic source of data, possibly transforming the data along the way or providing
additional functionality.-
Field Summary
Modifier and TypeFieldDescriptionprotected final AsynchronousFileChannel
The underlyingAsynchronousFileChannel
instance. -
Constructor Summary
ConstructorDescriptionConstruct aFilterAsynchronousFileChannel
based on the specified base channel. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
force
(boolean metaData) boolean
isOpen()
lock
(long position, long size, boolean shared) <A> void
lock
(long position, long size, boolean shared, A attachment, CompletionHandler<FileLock, ? super A> handler) read
(ByteBuffer dst, long position) <A> void
read
(ByteBuffer dst, long position, A attachment, CompletionHandler<Integer, ? super A> handler) long
size()
truncate
(long size) tryLock
(long position, long size, boolean shared) write
(ByteBuffer src, long position) <A> void
write
(ByteBuffer src, long position, A attachment, CompletionHandler<Integer, ? super A> handler)
-
Field Details
-
delegate
The underlyingAsynchronousFileChannel
instance.
-
-
Constructor Details
-
FilterAsynchronousFileChannel
Construct aFilterAsynchronousFileChannel
based on the specified base channel.Note that base channel is closed if this channel is closed.
- Parameters:
delegate
- specified base channel.
-
-
Method Details
-
close
- Throws:
IOException
-
isOpen
public boolean isOpen() -
size
- Specified by:
size
in classAsynchronousFileChannel
- Throws:
IOException
-
truncate
- Specified by:
truncate
in classAsynchronousFileChannel
- Throws:
IOException
-
force
- Specified by:
force
in classAsynchronousFileChannel
- Throws:
IOException
-
lock
public <A> void lock(long position, long size, boolean shared, A attachment, CompletionHandler<FileLock, ? super A> handler) - Specified by:
lock
in classAsynchronousFileChannel
-
lock
- Specified by:
lock
in classAsynchronousFileChannel
-
tryLock
- Specified by:
tryLock
in classAsynchronousFileChannel
- Throws:
IOException
-
read
public <A> void read(ByteBuffer dst, long position, A attachment, CompletionHandler<Integer, ? super A> handler) - Specified by:
read
in classAsynchronousFileChannel
-
read
- Specified by:
read
in classAsynchronousFileChannel
-
write
public <A> void write(ByteBuffer src, long position, A attachment, CompletionHandler<Integer, ? super A> handler) - Specified by:
write
in classAsynchronousFileChannel
-
write
- Specified by:
write
in classAsynchronousFileChannel
-