public class FilterAsynchronousFileChannel extends AsynchronousFileChannel
FilterAsynchronousFileChannel contains another
AsynchronousFileChannel, which it uses as its basic
source of data, possibly transforming the data along the
way or providing additional functionality.| Modifier and Type | Field and Description |
|---|---|
protected AsynchronousFileChannel |
delegate
The underlying
AsynchronousFileChannel instance. |
| Constructor and Description |
|---|
FilterAsynchronousFileChannel(AsynchronousFileChannel delegate)
Construct a
FilterAsynchronousFileChannel based on
the specified base channel. |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
force(boolean metaData) |
boolean |
isOpen() |
Future<FileLock> |
lock(long position,
long size,
boolean shared) |
<A> void |
lock(long position,
long size,
boolean shared,
A attachment,
CompletionHandler<FileLock,? super A> handler) |
Future<Integer> |
read(ByteBuffer dst,
long position) |
<A> void |
read(ByteBuffer dst,
long position,
A attachment,
CompletionHandler<Integer,? super A> handler) |
long |
size() |
AsynchronousFileChannel |
truncate(long size) |
FileLock |
tryLock(long position,
long size,
boolean shared) |
Future<Integer> |
write(ByteBuffer src,
long position) |
<A> void |
write(ByteBuffer src,
long position,
A attachment,
CompletionHandler<Integer,? super A> handler) |
protected final AsynchronousFileChannel delegate
AsynchronousFileChannel instance.public FilterAsynchronousFileChannel(AsynchronousFileChannel delegate)
FilterAsynchronousFileChannel based on
the specified base channel.
Note that base channel is closed if this channel is closed.
delegate - specified base channel.public void close()
throws IOException
IOExceptionpublic boolean isOpen()
public long size()
throws IOException
size in class AsynchronousFileChannelIOExceptionpublic AsynchronousFileChannel truncate(long size) throws IOException
truncate in class AsynchronousFileChannelIOExceptionpublic void force(boolean metaData)
throws IOException
force in class AsynchronousFileChannelIOExceptionpublic <A> void lock(long position,
long size,
boolean shared,
A attachment,
CompletionHandler<FileLock,? super A> handler)
lock in class AsynchronousFileChannelpublic Future<FileLock> lock(long position, long size, boolean shared)
lock in class AsynchronousFileChannelpublic FileLock tryLock(long position, long size, boolean shared) throws IOException
tryLock in class AsynchronousFileChannelIOExceptionpublic <A> void read(ByteBuffer dst, long position, A attachment, CompletionHandler<Integer,? super A> handler)
read in class AsynchronousFileChannelpublic Future<Integer> read(ByteBuffer dst, long position)
read in class AsynchronousFileChannelpublic <A> void write(ByteBuffer src, long position, A attachment, CompletionHandler<Integer,? super A> handler)
write in class AsynchronousFileChannelpublic Future<Integer> write(ByteBuffer src, long position)
write in class AsynchronousFileChannelCopyright © 2000-2021 Apache Software Foundation. All Rights Reserved.