Java Array arrayPrefixEqual(byte[] a1, int off1, byte[] a2, int off2, int len)

Here you can find the source of arrayPrefixEqual(byte[] a1, int off1, byte[] a2, int off2, int len)

Description

array Prefix Equal

License

Open Source License

Declaration

public static boolean arrayPrefixEqual(byte[] a1, int off1, byte[] a2, int off2, int len) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static boolean arrayPrefixEqual(byte[] a1, int off1, byte[] a2, int off2, int len) {
        if (off1 + len > a1.length)
            return false;
        if (off2 + len > a2.length)
            return false;
        for (int i = 0; i < len; i++)
            if (a1[off1 + i] != a2[off2 + i])
                return false;
        return true;
    }/* w  ww  . j  ava  2s.  co m*/
}

Related

  1. arrayMinus(double[] w, double[] v)
  2. arrayNotEmpty(T[] objects, String message)
  3. arrayOfClassType(T... array)
  4. arrayOffloatAsCSStrings(float[] ar)
  5. arrayOffloatCoordsAsCSStrings(float[] ar)
  6. arrayPrint(T[] arr)
  7. arrayPrint(T[] x)
  8. arrayPush(String[] array, String push)
  9. arrayRangeEquals(byte[] a, int aOffset, byte[] b, int bOffset, int byteCount)