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
A
FilterSeekableByteChannel
contains another SeekableByteChannel
, which it uses
as its basic source of data, possibly transforming the data along the way or providing additional
functionality.-
Field Summary
Modifier and TypeFieldDescriptionprotected final SeekableByteChannel
The underlyingSeekableByteChannel
instance. -
Constructor Summary
ConstructorDescriptionFilterSeekableByteChannel
(SeekableByteChannel delegate) Construct aFilterSeekableByteChannel
based on the specified base channel. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
boolean
isOpen()
long
position()
position
(long newPosition) int
read
(ByteBuffer dst) long
size()
truncate
(long size) int
write
(ByteBuffer src)
-
Field Details
-
delegate
The underlyingSeekableByteChannel
instance.
-
-
Constructor Details
-
FilterSeekableByteChannel
Construct aFilterSeekableByteChannel
based on the specified base channel.Note that base channel is closed if this channel is closed.
- Parameters:
delegate
- specified base channel.
-
-
Method Details
-
isOpen
public boolean isOpen() -
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceChannel
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
read
- Specified by:
read
in interfaceReadableByteChannel
- Specified by:
read
in interfaceSeekableByteChannel
- Throws:
IOException
-
write
- Specified by:
write
in interfaceSeekableByteChannel
- Specified by:
write
in interfaceWritableByteChannel
- Throws:
IOException
-
position
- Specified by:
position
in interfaceSeekableByteChannel
- Throws:
IOException
-
position
- Specified by:
position
in interfaceSeekableByteChannel
- Throws:
IOException
-
size
- Specified by:
size
in interfaceSeekableByteChannel
- Throws:
IOException
-
truncate
- Specified by:
truncate
in interfaceSeekableByteChannel
- Throws:
IOException
-