Java Array arrayRangeEquals(byte[] a, int aOffset, byte[] b, int bOffset, int byteCount)

Here you can find the source of arrayRangeEquals(byte[] a, int aOffset, byte[] b, int bOffset, int byteCount)

Description

array Range Equals

License

Apache License

Declaration

public static boolean arrayRangeEquals(byte[] a, int aOffset, byte[] b, int bOffset, int byteCount) 

Method Source Code

//package com.java2s;
/*//w  w w .j av a2s. c  o m
 * Copyright (C) 2014 Square, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

public class Main {
    public static boolean arrayRangeEquals(byte[] a, int aOffset, byte[] b, int bOffset, int byteCount) {
        for (int i = 0; i < byteCount; i++) {
            if (a[i + aOffset] != b[i + bOffset])
                return false;
        }
        return true;
    }
}

Related

  1. arrayOffloatCoordsAsCSStrings(float[] ar)
  2. arrayPrefixEqual(byte[] a1, int off1, byte[] a2, int off2, int len)
  3. arrayPrint(T[] arr)
  4. arrayPrint(T[] x)
  5. arrayPush(String[] array, String push)
  6. arrayRepresentsProbability(double[] probs)
  7. arraySame(Object[] array1, Object[] array2)
  8. arraysConvert(String[] src, int column)
  9. arraySeekDelete(final T[] arr, final T[] dest, final T... dels)