Here you can find the source of startsWith(byte[] target, int offset, byte[] litmusPaper)
public static boolean startsWith(byte[] target, int offset, byte[] litmusPaper)
//package com.java2s; //License from project: Apache License public class Main { public static boolean startsWith(byte[] target, int offset, byte[] litmusPaper) { if ((target.length - offset) < litmusPaper.length) { return false; }/* w w w . j a va 2 s . com*/ for (int i = offset, j = 0; j < litmusPaper.length; i++, j++) { if (target[i] != litmusPaper[j]) { return false; } } return true; } }