org.apache.lucene.mockfile

## Class FilterFileChannel

- java.lang.Object
- - java.nio.channels.spi.AbstractInterruptibleChannel
  - - java.nio.channels.FileChannel
    - - org.apache.lucene.mockfile.FilterFileChannel

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

      public abstract class FilterFileChannel
      extends FileChannel

  A `FilterFileChannel` contains another `FileChannel`, which it uses as its basic source of data, possibly transforming the data along the way or providing additional functionality.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class java.nio.channels.FileChannel

      `FileChannel.MapMode`

  - ### Field Summary

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

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `force(boolean metaData)`
    `protected void` | `implCloseChannel()`
    `FileLock` | `lock(long position, long size, boolean shared)`
    `MappedByteBuffer` | `map(FileChannel.MapMode mode, long position, long size)`
    `long` | `position()`
    `FileChannel` | `position(long newPosition)`
    `int` | `read(ByteBuffer dst)`
    `long` | `read(ByteBuffer[] dsts, int offset, int length)`
    `int` | `read(ByteBuffer dst, long position)`
    `long` | `size()`
    `long` | `transferFrom(ReadableByteChannel src, long position, long count)`
    `long` | `transferTo(long position, long count, WritableByteChannel target)`
    `FileChannel` | `truncate(long size)`
    `FileLock` | `tryLock(long position, long size, boolean shared)`
    `int` | `write(ByteBuffer src)`
    `long` | `write(ByteBuffer[] srcs, int offset, int length)`
    `int` | `write(ByteBuffer src, long position)`

    - ### Methods inherited from class java.nio.channels.FileChannel

      `lock, open, open, read, tryLock, write`

    - ### Methods inherited from class java.nio.channels.spi.AbstractInterruptibleChannel

      `begin, close, end, isOpen`

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

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

    - ### Methods inherited from interface java.nio.channels.Channel

      `close, isOpen`

- - ### Field Detail

    - #### delegate

          protected final FileChannel delegate

      The underlying `FileChannel` instance.

  - ### Constructor Detail

    - #### FilterFileChannel

          public FilterFileChannel(FileChannel delegate)

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

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

      Parameters:
        `delegate` - specified base channel.

  - ### Method Detail

    - #### read

          public int read(ByteBuffer dst)
                   throws IOException

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

    - #### read

          public long read(ByteBuffer[] dsts,
                           int offset,
                           int length)
                    throws IOException

      Specified by:
        `read` in interface `ScatteringByteChannel`
      Specified by:
        `read` in class `FileChannel`
      Throws:
        `IOException`

    - #### write

          public int write(ByteBuffer src)
                    throws IOException

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

    - #### write

          public long write(ByteBuffer[] srcs,
                            int offset,
                            int length)
                     throws IOException

      Specified by:
        `write` in interface `GatheringByteChannel`
      Specified by:
        `write` in class `FileChannel`
      Throws:
        `IOException`

    - #### position

          public long position()
                        throws IOException

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

    - #### position

          public FileChannel position(long newPosition)
                               throws IOException

      Specified by:
        `position` in interface `SeekableByteChannel`
      Overrides:
        `position` in class `FileChannel`
      Throws:
        `IOException`

    - #### size

          public long size()
                    throws IOException

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

    - #### truncate

          public FileChannel truncate(long size)
                               throws IOException

      Specified by:
        `truncate` in interface `SeekableByteChannel`
      Overrides:
        `truncate` in class `FileChannel`
      Throws:
        `IOException`

    - #### force

          public void force(boolean metaData)
                     throws IOException

      Specified by:
        `force` in class `FileChannel`
      Throws:
        `IOException`

    - #### transferTo

          public long transferTo(long position,
                                 long count,
                                 WritableByteChannel target)
                          throws IOException

      Specified by:
        `transferTo` in class `FileChannel`
      Throws:
        `IOException`

    - #### transferFrom

          public long transferFrom(ReadableByteChannel src,
                                   long position,
                                   long count)
                            throws IOException

      Specified by:
        `transferFrom` in class `FileChannel`
      Throws:
        `IOException`

    - #### read

          public int read(ByteBuffer dst,
                          long position)
                   throws IOException

      Specified by:
        `read` in class `FileChannel`
      Throws:
        `IOException`

    - #### write

          public int write(ByteBuffer src,
                           long position)
                    throws IOException

      Specified by:
        `write` in class `FileChannel`
      Throws:
        `IOException`

    - #### map

          public MappedByteBuffer map(FileChannel.MapMode mode,
                                      long position,
                                      long size)
                               throws IOException

      Specified by:
        `map` in class `FileChannel`
      Throws:
        `IOException`

    - #### lock

          public FileLock lock(long position,
                               long size,
                               boolean shared)
                        throws IOException

      Specified by:
        `lock` in class `FileChannel`
      Throws:
        `IOException`

    - #### tryLock

          public FileLock tryLock(long position,
                                  long size,
                                  boolean shared)
                           throws IOException

      Specified by:
        `tryLock` in class `FileChannel`
      Throws:
        `IOException`

    - #### implCloseChannel

          protected void implCloseChannel()
                                   throws IOException

      Specified by:
        `implCloseChannel` in class `AbstractInterruptibleChannel`
      Throws:
        `IOException`

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