Here you can find the source of startsWith(byte[] bytes, String str, int offset)
static boolean startsWith(byte[] bytes, String str, int offset)
//package com.java2s; public class Main { static boolean startsWith(byte[] bytes, String str, int offset) { if (bytes.length < (offset + str.length())) return false; for (int c = 0; c < str.length(); c++) { if (bytes[offset + c] != str.charAt(c)) return false; }//from w w w . j a va 2s. c om return true; } }