Class FileChannels


  • public final class FileChannels
    extends java.lang.Object
    Works with FileChannel.
    Since:
    2.15.0
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private FileChannels()
      Don't instantiate.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean contentEquals​(java.nio.channels.FileChannel channel1, java.nio.channels.FileChannel channel2, int byteBufferSize)
      Tests if two RandomAccessFiles contents are equal.
      private static long size​(java.nio.channels.FileChannel channel)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FileChannels

        private FileChannels()
        Don't instantiate.
    • Method Detail

      • contentEquals

        public static boolean contentEquals​(java.nio.channels.FileChannel channel1,
                                            java.nio.channels.FileChannel channel2,
                                            int byteBufferSize)
                                     throws java.io.IOException
        Tests if two RandomAccessFiles contents are equal.
        Parameters:
        channel1 - A FileChannel.
        channel2 - Another FileChannel.
        byteBufferSize - The two internal buffer capacities, in bytes.
        Returns:
        true if the contents of both RandomAccessFiles are equal, false otherwise.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • size

        private static long size​(java.nio.channels.FileChannel channel)
                          throws java.io.IOException
        Throws:
        java.io.IOException