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
IOException
public boolean isOpen()
public long size() throws IOException
size
in class AsynchronousFileChannel
IOException
public AsynchronousFileChannel truncate(long size) throws IOException
truncate
in class AsynchronousFileChannel
IOException
public void force(boolean metaData) throws IOException
force
in class AsynchronousFileChannel
IOException
public <A> void lock(long position, long size, boolean shared, A attachment, CompletionHandler<FileLock,? super A> handler)
lock
in class AsynchronousFileChannel
public Future<FileLock> lock(long position, long size, boolean shared)
lock
in class AsynchronousFileChannel
public FileLock tryLock(long position, long size, boolean shared) throws IOException
tryLock
in class AsynchronousFileChannel
IOException
public <A> void read(ByteBuffer dst, long position, A attachment, CompletionHandler<Integer,? super A> handler)
read
in class AsynchronousFileChannel
public Future<Integer> read(ByteBuffer dst, long position)
read
in class AsynchronousFileChannel
public <A> void write(ByteBuffer src, long position, A attachment, CompletionHandler<Integer,? super A> handler)
write
in class AsynchronousFileChannel
public Future<Integer> write(ByteBuffer src, long position)
write
in class AsynchronousFileChannel
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.