Android Byte Array Compare compare(byte[] as, byte[] bs)

Here you can find the source of compare(byte[] as, byte[] bs)

Description

compare

Declaration

public static boolean compare(byte[] as, byte[] bs) 

Method Source Code

//package com.java2s;

public class Main {
    public static boolean compare(byte[] as, byte[] bs) {
        boolean result = true;
        int len = as.length;
        if (len != bs.length) {
            return false;
        }//w  ww  .j  a va  2  s .c o  m
        for (int i = 0; i < len; i++) {
            if (as[i] != bs[i]) {
                result = false;
                return result;
            }
        }
        return result;
    }
}

Related

  1. findWhereDiffer(byte[] bytes1, byte[] bytes2, int limit)
  2. compare(byte[] a, byte[] b)
  3. compare(byte[] a, int a_pos, byte[] b, int b_pos, int length)
  4. compareByteArray(byte[] src, byte[] dst)
  5. compareByteArray(byte[] src, int srcOffset, byte[] dst, int dstOffset, int length)
  6. compareByteArray(byte[] src, int srcOffset, int srcLen, byte[] dst, int dstOffset, int dstLen)
  7. compareNotNull(byte[] data1, byte[] data2)