Here you can find the source of bytesEqual(byte[] buf1, byte[] buf2, int off, int len)
public static boolean bytesEqual(byte[] buf1, byte[] buf2, int off, int len)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); public class Main { public static boolean bytesEqual(byte[] buf1, byte[] buf2, int off, int len) { for (int i = off; i < off + len; i++) { if (i >= buf1.length || i >= buf2.length) { return false; }//from ww w . j a v a2s . c o m if (buf1[i] != buf2[i]) { return false; } } return true; } }