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.IOException
public boolean isOpen()
public long size() throws java.io.IOException
size
in class java.nio.channels.AsynchronousFileChannel
java.io.IOException
public java.nio.channels.AsynchronousFileChannel truncate(long size) throws java.io.IOException
truncate
in class java.nio.channels.AsynchronousFileChannel
java.io.IOException
public void force(boolean metaData) throws java.io.IOException
force
in class java.nio.channels.AsynchronousFileChannel
java.io.IOException
public <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.AsynchronousFileChannel
public java.util.concurrent.Future<java.nio.channels.FileLock> lock(long position, long size, boolean shared)
lock
in class java.nio.channels.AsynchronousFileChannel
public java.nio.channels.FileLock tryLock(long position, long size, boolean shared) throws java.io.IOException
tryLock
in class java.nio.channels.AsynchronousFileChannel
java.io.IOException
public <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.AsynchronousFileChannel
public java.util.concurrent.Future<java.lang.Integer> read(java.nio.ByteBuffer dst, long position)
read
in class java.nio.channels.AsynchronousFileChannel
public <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.AsynchronousFileChannel
public java.util.concurrent.Future<java.lang.Integer> write(java.nio.ByteBuffer src, long position)
write
in class java.nio.channels.AsynchronousFileChannel
Copyright © 2000–2019 The Apache Software Foundation. All rights reserved.