Here you can find the source of allEquals(byte[] array, byte value, int offset, int maxLength)
public static boolean allEquals(byte[] array, byte value, int offset, int maxLength)
//package com.java2s; /*/*from w ww . j av a 2 s . c o m*/ * Copyright (c) 2015. Troels Liebe Bentsen <tlb@nversion.dk> * Licensed under the MIT license (LICENSE.txt) */ public class Main { public static boolean allEquals(byte[] array, byte value, int offset, int maxLength) { maxLength = Math.min(offset + maxLength, array.length); for (int i = offset; i < maxLength; i++) { if (array[i] != value) { return false; } } return true; } }