@NotThreadSafe public class BufferedReadOnlyChannel extends ReadOnlyChannel
channel
Constructor and Description |
---|
BufferedReadOnlyChannel(SeekableByteChannel channel)
Constructs a new buffered read-only channel.
|
BufferedReadOnlyChannel(SeekableByteChannel channel,
int bufferSize)
Constructs a new buffered read-only channel.
|
Modifier and Type | Method and Description |
---|---|
long |
position() |
SeekableByteChannel |
position(long pos) |
int |
read(ByteBuffer dst) |
BufferedReadOnlyChannel |
sync()
Notifies this channel of concurrent changes in its decorated channel.
|
truncate, write
close, isOpen, size, toString
checkOpen
@CreatesObligation public BufferedReadOnlyChannel(@WillCloseWhenClosed SeekableByteChannel channel)
channel
- the channel to decorate.@CreatesObligation public BufferedReadOnlyChannel(@WillCloseWhenClosed SeekableByteChannel channel, int bufferSize)
channel
- the channel to decorate.bufferSize
- the size of the byte buffer.public long position() throws IOException
position
in interface SeekableByteChannel
position
in class DecoratingSeekableChannel
IOException
public SeekableByteChannel position(long pos) throws IOException
position
in interface SeekableByteChannel
position
in class DecoratingSeekableChannel
IOException
public int read(ByteBuffer dst) throws IOException
read
in interface ReadableByteChannel
read
in interface SeekableByteChannel
read
in class DecoratingSeekableChannel
IOException
public BufferedReadOnlyChannel sync()
this
Copyright © 2012–2017 Schlichtherle IT Services. All rights reserved.