org.apache.lucene.mockfile

## Class FilterSeekableByteChannel

- java.lang.Object
- - org.apache.lucene.mockfile.FilterSeekableByteChannel

- All Implemented Interfaces:
    Closeable, AutoCloseable, ByteChannel, Channel, ReadableByteChannel, SeekableByteChannel, WritableByteChannel

      public class FilterSeekableByteChannel
      extends Object
      implements SeekableByteChannel

  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

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected SeekableByteChannel` | `delegate` The underlying `SeekableByteChannel` instance.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FilterSeekableByteChannel(SeekableByteChannel delegate)` Construct a `FilterSeekableByteChannel` based on the specified base channel.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `boolean` | `isOpen()`
    `long` | `position()`
    `SeekableByteChannel` | `position(long newPosition)`
    `int` | `read(ByteBuffer dst)`
    `long` | `size()`
    `SeekableByteChannel` | `truncate(long size)`
    `int` | `write(ByteBuffer src)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### delegate

          protected final SeekableByteChannel delegate

      The underlying `SeekableByteChannel` instance.

  - ### Constructor Detail

    - #### FilterSeekableByteChannel

          public FilterSeekableByteChannel(SeekableByteChannel delegate)

      Construct a `FilterSeekableByteChannel` based on the specified base channel.

      Note that base channel is closed if this channel is closed.

      Parameters:
        `delegate` - specified base channel.

  - ### Method Detail

    - #### isOpen

          public boolean isOpen()

      Specified by:
        `isOpen` in interface `Channel`

    - #### close

          public void close()
                     throws IOException

      Specified by:
        `close` in interface `Closeable`
      Specified by:
        `close` in interface `AutoCloseable`
      Specified by:
        `close` in interface `Channel`
      Throws:
        `IOException`

    - #### read

          public int read(ByteBuffer dst)
                   throws IOException

      Specified by:
        `read` in interface `ReadableByteChannel`
      Specified by:
        `read` in interface `SeekableByteChannel`
      Throws:
        `IOException`

    - #### write

          public int write(ByteBuffer src)
                    throws IOException

      Specified by:
        `write` in interface `SeekableByteChannel`
      Specified by:
        `write` in interface `WritableByteChannel`
      Throws:
        `IOException`

    - #### position

          public long position()
                        throws IOException

      Specified by:
        `position` in interface `SeekableByteChannel`
      Throws:
        `IOException`

    - #### position

          public SeekableByteChannel position(long newPosition)
                                       throws IOException

      Specified by:
        `position` in interface `SeekableByteChannel`
      Throws:
        `IOException`

    - #### size

          public long size()
                    throws IOException

      Specified by:
        `size` in interface `SeekableByteChannel`
      Throws:
        `IOException`

    - #### truncate

          public SeekableByteChannel truncate(long size)
                                       throws IOException

      Specified by:
        `truncate` in interface `SeekableByteChannel`
      Throws:
        `IOException`

Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.