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
FieldsModifier and TypeFieldDescriptionprotected final AsynchronousFileChannelThe underlyingAsynchronousFileChannelinstance. -
Constructor Summary
ConstructorsConstructorDescriptionConstruct aFilterAsynchronousFileChannelbased on the specified base channel. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidforce(boolean metaData) booleanisOpen()lock(long position, long size, boolean shared) <A> voidlock(long position, long size, boolean shared, A attachment, CompletionHandler<FileLock, ? super A> handler) read(ByteBuffer dst, long position) <A> voidread(ByteBuffer dst, long position, A attachment, CompletionHandler<Integer, ? super A> handler) longsize()truncate(long size) tryLock(long position, long size, boolean shared) write(ByteBuffer src, long position) <A> voidwrite(ByteBuffer src, long position, A attachment, CompletionHandler<Integer, ? super A> handler)
-
Field Details
-
delegate
The underlyingAsynchronousFileChannelinstance.
-
-
Constructor Details
-
FilterAsynchronousFileChannel
Construct aFilterAsynchronousFileChannelbased 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:
sizein classAsynchronousFileChannel- Throws:
IOException
-
truncate
- Specified by:
truncatein classAsynchronousFileChannel- Throws:
IOException
-
force
- Specified by:
forcein classAsynchronousFileChannel- Throws:
IOException
-
lock
public <A> void lock(long position, long size, boolean shared, A attachment, CompletionHandler<FileLock, ? super A> handler) - Specified by:
lockin classAsynchronousFileChannel
-
lock
- Specified by:
lockin classAsynchronousFileChannel
-
tryLock
- Specified by:
tryLockin classAsynchronousFileChannel- Throws:
IOException
-
read
public <A> void read(ByteBuffer dst, long position, A attachment, CompletionHandler<Integer, ? super A> handler) - Specified by:
readin classAsynchronousFileChannel
-
read
- Specified by:
readin classAsynchronousFileChannel
-
write
public <A> void write(ByteBuffer src, long position, A attachment, CompletionHandler<Integer, ? super A> handler) - Specified by:
writein classAsynchronousFileChannel
-
write
- Specified by:
writein classAsynchronousFileChannel
-