Package org.apache.lucene.tests.mockfile
Class FilterSeekableByteChannel
- java.lang.Object
-
- org.apache.lucene.tests.mockfile.FilterSeekableByteChannel
-
- All Implemented Interfaces:
Closeable,AutoCloseable,ByteChannel,Channel,ReadableByteChannel,SeekableByteChannel,WritableByteChannel
public class FilterSeekableByteChannel extends Object implements SeekableByteChannel
AFilterSeekableByteChannelcontains anotherSeekableByteChannel, which it uses as its basic source of data, possibly transforming the data along the way or providing additional functionality.
-
-
Field Summary
Fields Modifier and Type Field Description protected SeekableByteChanneldelegateThe underlyingSeekableByteChannelinstance.
-
Constructor Summary
Constructors Constructor Description FilterSeekableByteChannel(SeekableByteChannel delegate)Construct aFilterSeekableByteChannelbased on the specified base channel.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()booleanisOpen()longposition()SeekableByteChannelposition(long newPosition)intread(ByteBuffer dst)longsize()SeekableByteChanneltruncate(long size)intwrite(ByteBuffer src)
-
-
-
Field Detail
-
delegate
protected final SeekableByteChannel delegate
The underlyingSeekableByteChannelinstance.
-
-
Constructor Detail
-
FilterSeekableByteChannel
public FilterSeekableByteChannel(SeekableByteChannel delegate)
Construct aFilterSeekableByteChannelbased on the specified base channel.Note that base channel is closed if this channel is closed.
- Parameters:
delegate- specified base channel.
-
-
Method Detail
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceChannel- Specified by:
closein interfaceCloseable- Throws:
IOException
-
read
public int read(ByteBuffer dst) throws IOException
- Specified by:
readin interfaceReadableByteChannel- Specified by:
readin interfaceSeekableByteChannel- Throws:
IOException
-
write
public int write(ByteBuffer src) throws IOException
- Specified by:
writein interfaceSeekableByteChannel- Specified by:
writein interfaceWritableByteChannel- Throws:
IOException
-
position
public long position() throws IOException- Specified by:
positionin interfaceSeekableByteChannel- Throws:
IOException
-
position
public SeekableByteChannel position(long newPosition) throws IOException
- Specified by:
positionin interfaceSeekableByteChannel- Throws:
IOException
-
size
public long size() throws IOException- Specified by:
sizein interfaceSeekableByteChannel- Throws:
IOException
-
truncate
public SeekableByteChannel truncate(long size) throws IOException
- Specified by:
truncatein interfaceSeekableByteChannel- Throws:
IOException
-
-