org.apache.lucene.mockfile

## Class FilterAsynchronousFileChannel

- java.lang.Object
- - java.nio.channels.AsynchronousFileChannel
  - - org.apache.lucene.mockfile.FilterAsynchronousFileChannel

- All Implemented Interfaces:
    Closeable, AutoCloseable, AsynchronousChannel, Channel

      public class FilterAsynchronousFileChannel
      extends AsynchronousFileChannel

  A `FilterAsynchronousFileChannel` contains another `AsynchronousFileChannel`, 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 AsynchronousFileChannel` | `delegate` The underlying `AsynchronousFileChannel` instance.

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `void` | `force(boolean metaData)`
    `boolean` | `isOpen()`
    `Future<FileLock>` | `lock(long position, long size, boolean shared)`
    `<A> void` | `lock(long position, long size, boolean shared, A attachment, CompletionHandler<FileLock,? super A> handler)`
    `Future<Integer>` | `read(ByteBuffer dst, long position)`
    `<A> void` | `read(ByteBuffer dst, long position, A attachment, CompletionHandler<Integer,? super A> handler)`
    `long` | `size()`
    `AsynchronousFileChannel` | `truncate(long size)`
    `FileLock` | `tryLock(long position, long size, boolean shared)`
    `Future<Integer>` | `write(ByteBuffer src, long position)`
    `<A> void` | `write(ByteBuffer src, long position, A attachment, CompletionHandler<Integer,? super A> handler)`

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

      `lock, lock, open, open, tryLock`

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

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

- - ### Field Detail

    - #### delegate

          protected final AsynchronousFileChannel delegate

      The underlying `AsynchronousFileChannel` instance.

  - ### Constructor Detail

    - #### FilterAsynchronousFileChannel

          public FilterAsynchronousFileChannel(AsynchronousFileChannel delegate)

      Construct a `FilterAsynchronousFileChannel` based 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

      Throws:
        `IOException`

    - #### isOpen

          public boolean isOpen()

    - #### size

          public long size()
                    throws IOException

      Specified by:
        `size` in class `AsynchronousFileChannel`
      Throws:
        `IOException`

    - #### truncate

          public AsynchronousFileChannel truncate(long size)
                                           throws IOException

      Specified by:
        `truncate` in class `AsynchronousFileChannel`
      Throws:
        `IOException`

    - #### force

          public void force(boolean metaData)
                     throws IOException

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

    - #### lock

          public <A> void lock(long position,
                               long size,
                               boolean shared,
                               A attachment,
                               CompletionHandler<FileLock,? super A> handler)

      Specified by:
        `lock` in class `AsynchronousFileChannel`

    - #### lock

          public Future<FileLock> lock(long position,
                                       long size,
                                       boolean shared)

      Specified by:
        `lock` in class `AsynchronousFileChannel`

    - #### tryLock

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

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

    - #### read

          public <A> void read(ByteBuffer dst,
                               long position,
                               A attachment,
                               CompletionHandler<Integer,? super A> handler)

      Specified by:
        `read` in class `AsynchronousFileChannel`

    - #### read

          public Future<Integer> read(ByteBuffer dst,
                                      long position)

      Specified by:
        `read` in class `AsynchronousFileChannel`

    - #### write

          public <A> void write(ByteBuffer src,
                                long position,
                                A attachment,
                                CompletionHandler<Integer,? super A> handler)

      Specified by:
        `write` in class `AsynchronousFileChannel`

    - #### write

          public Future<Integer> write(ByteBuffer src,
                                       long position)

      Specified by:
        `write` in class `AsynchronousFileChannel`

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