Here you can find the source of startsWith(byte[] nameRaw, byte[] namePrefix)
private static boolean startsWith(byte[] nameRaw, byte[] namePrefix)
//package com.java2s; //License from project: Mozilla Public License public class Main { private static boolean startsWith(byte[] nameRaw, byte[] namePrefix) { for (int i = 0; i < namePrefix.length; i++) { if (namePrefix[i] != nameRaw[i]) return false; }/*from w ww. j a va 2 s. c o m*/ return true; } }