org.apache.commons.io.channels

## Class FileChannels

- java.lang.Object
- - org.apache.commons.io.channels.FileChannels

-     public final class FileChannels
      extends Object

  Works with `FileChannel`.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static boolean` | `contentEquals(ReadableByteChannel channel1, ReadableByteChannel channel2, int bufferCapacity)` Tests if two readable byte channel contents are equal starting at their respective current positions.
    `static boolean` | `contentEquals(SeekableByteChannel channel1, SeekableByteChannel channel2, int bufferCapacity)` Tests if two seekable byte channel contents are equal starting at their respective current positions.

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

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

- - ### Method Detail

    - #### contentEquals

          public static boolean contentEquals(ReadableByteChannel channel1,
                                              ReadableByteChannel channel2,
                                              int bufferCapacity)
                                       throws IOException

      Tests if two readable byte channel contents are equal starting at their respective current positions.
      Parameters:
        `channel1` - A readable byte channel.
        `channel2` - Another readable byte channel.
        `bufferCapacity` - The two internal buffer capacities, in bytes.
      Returns:
        true if the contents of both RandomAccessFiles are equal, false otherwise.
      Throws:
        `IOException` - if an I/O error occurs or the timeout is met.

    - #### contentEquals

          public static boolean contentEquals(SeekableByteChannel channel1,
                                              SeekableByteChannel channel2,
                                              int bufferCapacity)
                                       throws IOException

      Tests if two seekable byte channel contents are equal starting at their respective current positions.

      If the two channels have different sizes, no content comparison takes place, and this method returns false.

      Parameters:
        `channel1` - A seekable byte channel.
        `channel2` - Another seekable byte channel.
        `bufferCapacity` - The two internal buffer capacities, in bytes.
      Returns:
        true if the contents of both RandomAccessFiles are equal, false otherwise.
      Throws:
        `IOException` - if an I/O error occurs or the timeout is met.