Java Byte Array Equal bytesEqual(final byte[] b1, final int j, final byte[] b2, final int k, final int len)

Here you can find the source of bytesEqual(final byte[] b1, final int j, final byte[] b2, final int k, final int len)

Description

Return true if the byte ranges are identical.

License

Open Source License

Declaration

public static final boolean bytesEqual(final byte[] b1, final int j, final byte[] b2, final int k,
        final int len) 

Method Source Code

//package com.java2s;

public class Main {
    /**//from  w  ww . j  av  a  2s.com
     * Return true if the byte ranges are identical.
     */
    public static final boolean bytesEqual(final byte[] b1, final int j, final byte[] b2, final int k,
            final int len) {
        for (int i = 0; i < len; i++) {
            if (b1[i + j] != b2[i + k])
                return false;
        }
        return true;
    }
}

Related

  1. bytesEqual(byte[] a, int aOff, byte[] b, int bOff, int len)
  2. bytesEqual(byte[] a1, byte[] a2)
  3. bytesEqual(byte[] a1, byte[] a2)
  4. bytesEqual(byte[] buf1, byte[] buf2, int off, int len)
  5. bytesEqual(final byte[] a, final byte[] b)
  6. bytesEqual(final byte[] source, final int offset, final byte[] target)