public class FilterAsynchronousFileChannel
extends java.nio.channels.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 java.nio.channels.AsynchronousFileChannel |
delegate
The underlying
AsynchronousFileChannel instance. |
| Constructor and Description |
|---|
FilterAsynchronousFileChannel(java.nio.channels.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() |
java.util.concurrent.Future<java.nio.channels.FileLock> |
lock(long position,
long size,
boolean shared) |
<A> void |
lock(long position,
long size,
boolean shared,
A attachment,
java.nio.channels.CompletionHandler<java.nio.channels.FileLock,? super A> handler) |
java.util.concurrent.Future<java.lang.Integer> |
read(java.nio.ByteBuffer dst,
long position) |
<A> void |
read(java.nio.ByteBuffer dst,
long position,
A attachment,
java.nio.channels.CompletionHandler<java.lang.Integer,? super A> handler) |
long |
size() |
java.nio.channels.AsynchronousFileChannel |
truncate(long size) |
java.nio.channels.FileLock |
tryLock(long position,
long size,
boolean shared) |
java.util.concurrent.Future<java.lang.Integer> |
write(java.nio.ByteBuffer src,
long position) |
<A> void |
write(java.nio.ByteBuffer src,
long position,
A attachment,
java.nio.channels.CompletionHandler<java.lang.Integer,? super A> handler) |
protected final java.nio.channels.AsynchronousFileChannel delegate
AsynchronousFileChannel instance.public FilterAsynchronousFileChannel(java.nio.channels.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 java.io.IOException
java.io.IOExceptionpublic boolean isOpen()
public long size()
throws java.io.IOException
size in class java.nio.channels.AsynchronousFileChanneljava.io.IOExceptionpublic java.nio.channels.AsynchronousFileChannel truncate(long size)
throws java.io.IOException
truncate in class java.nio.channels.AsynchronousFileChanneljava.io.IOExceptionpublic void force(boolean metaData)
throws java.io.IOException
force in class java.nio.channels.AsynchronousFileChanneljava.io.IOExceptionpublic <A> void lock(long position,
long size,
boolean shared,
A attachment,
java.nio.channels.CompletionHandler<java.nio.channels.FileLock,? super A> handler)
lock in class java.nio.channels.AsynchronousFileChannelpublic java.util.concurrent.Future<java.nio.channels.FileLock> lock(long position,
long size,
boolean shared)
lock in class java.nio.channels.AsynchronousFileChannelpublic java.nio.channels.FileLock tryLock(long position,
long size,
boolean shared)
throws java.io.IOException
tryLock in class java.nio.channels.AsynchronousFileChanneljava.io.IOExceptionpublic <A> void read(java.nio.ByteBuffer dst,
long position,
A attachment,
java.nio.channels.CompletionHandler<java.lang.Integer,? super A> handler)
read in class java.nio.channels.AsynchronousFileChannelpublic java.util.concurrent.Future<java.lang.Integer> read(java.nio.ByteBuffer dst,
long position)
read in class java.nio.channels.AsynchronousFileChannelpublic <A> void write(java.nio.ByteBuffer src,
long position,
A attachment,
java.nio.channels.CompletionHandler<java.lang.Integer,? super A> handler)
write in class java.nio.channels.AsynchronousFileChannelpublic java.util.concurrent.Future<java.lang.Integer> write(java.nio.ByteBuffer src,
long position)
write in class java.nio.channels.AsynchronousFileChannelCopyright © 2000–2025 The Apache Software Foundation. All rights reserved.