Here you can find the source of startsWith(byte a[], int from, byte b[])
static public boolean startsWith(byte a[], int from, byte b[])
//package com.java2s; //License from project: Apache License public class Main { static public int startsWith(String s, String prefix[]) { if (s == null || prefix == null) return -1; for (int i = 0; i < prefix.length; i++) { if (s.startsWith(prefix[i])) return i; }/*from w w w .j av a2 s. c om*/ return -1; } static public boolean startsWith(byte a[], int from, byte b[]) { final int nb = b.length; for (int i = 0; i < nb; i++) { final int j = from + i; if (j >= a.length || a[j] != b[i]) return false; } return true; } }