public abstract class FilterFileChannel
extends java.nio.channels.FileChannel
FilterFileChannel
contains another
FileChannel
, 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.FileChannel |
delegate
The underlying
FileChannel instance. |
Constructor and Description |
---|
FilterFileChannel(java.nio.channels.FileChannel delegate)
Construct a
FilterFileChannel based on
the specified base channel. |
Modifier and Type | Method and Description |
---|---|
void |
force(boolean metaData) |
protected void |
implCloseChannel() |
java.nio.channels.FileLock |
lock(long position,
long size,
boolean shared) |
java.nio.MappedByteBuffer |
map(java.nio.channels.FileChannel.MapMode mode,
long position,
long size) |
long |
position() |
java.nio.channels.FileChannel |
position(long newPosition) |
int |
read(java.nio.ByteBuffer dst) |
long |
read(java.nio.ByteBuffer[] dsts,
int offset,
int length) |
int |
read(java.nio.ByteBuffer dst,
long position) |
long |
size() |
long |
transferFrom(java.nio.channels.ReadableByteChannel src,
long position,
long count) |
long |
transferTo(long position,
long count,
java.nio.channels.WritableByteChannel target) |
java.nio.channels.FileChannel |
truncate(long size) |
java.nio.channels.FileLock |
tryLock(long position,
long size,
boolean shared) |
int |
write(java.nio.ByteBuffer src) |
long |
write(java.nio.ByteBuffer[] srcs,
int offset,
int length) |
int |
write(java.nio.ByteBuffer src,
long position) |
begin, close, end, isOpen
protected final java.nio.channels.FileChannel delegate
FileChannel
instance.public FilterFileChannel(java.nio.channels.FileChannel delegate)
FilterFileChannel
based on
the specified base channel.
Note that base channel is closed if this channel is closed.
delegate
- specified base channel.public int read(java.nio.ByteBuffer dst) throws java.io.IOException
read
in interface java.nio.channels.ReadableByteChannel
read
in interface java.nio.channels.SeekableByteChannel
read
in class java.nio.channels.FileChannel
java.io.IOException
public long read(java.nio.ByteBuffer[] dsts, int offset, int length) throws java.io.IOException
read
in interface java.nio.channels.ScatteringByteChannel
read
in class java.nio.channels.FileChannel
java.io.IOException
public int write(java.nio.ByteBuffer src) throws java.io.IOException
write
in interface java.nio.channels.SeekableByteChannel
write
in interface java.nio.channels.WritableByteChannel
write
in class java.nio.channels.FileChannel
java.io.IOException
public long write(java.nio.ByteBuffer[] srcs, int offset, int length) throws java.io.IOException
write
in interface java.nio.channels.GatheringByteChannel
write
in class java.nio.channels.FileChannel
java.io.IOException
public long position() throws java.io.IOException
position
in interface java.nio.channels.SeekableByteChannel
position
in class java.nio.channels.FileChannel
java.io.IOException
public java.nio.channels.FileChannel position(long newPosition) throws java.io.IOException
position
in interface java.nio.channels.SeekableByteChannel
position
in class java.nio.channels.FileChannel
java.io.IOException
public long size() throws java.io.IOException
size
in interface java.nio.channels.SeekableByteChannel
size
in class java.nio.channels.FileChannel
java.io.IOException
public java.nio.channels.FileChannel truncate(long size) throws java.io.IOException
truncate
in interface java.nio.channels.SeekableByteChannel
truncate
in class java.nio.channels.FileChannel
java.io.IOException
public void force(boolean metaData) throws java.io.IOException
force
in class java.nio.channels.FileChannel
java.io.IOException
public long transferTo(long position, long count, java.nio.channels.WritableByteChannel target) throws java.io.IOException
transferTo
in class java.nio.channels.FileChannel
java.io.IOException
public long transferFrom(java.nio.channels.ReadableByteChannel src, long position, long count) throws java.io.IOException
transferFrom
in class java.nio.channels.FileChannel
java.io.IOException
public int read(java.nio.ByteBuffer dst, long position) throws java.io.IOException
read
in class java.nio.channels.FileChannel
java.io.IOException
public int write(java.nio.ByteBuffer src, long position) throws java.io.IOException
write
in class java.nio.channels.FileChannel
java.io.IOException
public java.nio.MappedByteBuffer map(java.nio.channels.FileChannel.MapMode mode, long position, long size) throws java.io.IOException
map
in class java.nio.channels.FileChannel
java.io.IOException
public java.nio.channels.FileLock lock(long position, long size, boolean shared) throws java.io.IOException
lock
in class java.nio.channels.FileChannel
java.io.IOException
public java.nio.channels.FileLock tryLock(long position, long size, boolean shared) throws java.io.IOException
tryLock
in class java.nio.channels.FileChannel
java.io.IOException
protected void implCloseChannel() throws java.io.IOException
implCloseChannel
in class java.nio.channels.spi.AbstractInterruptibleChannel
java.io.IOException
Copyright © 2000–2019 The Apache Software Foundation. All rights reserved.