Here you can find the source of startWith(byte[] startWith, byte[] bytes)
Parameter | Description |
---|---|
startWith | The bytes to start with |
bytes | The bytes to test |
public static boolean startWith(byte[] startWith, byte[] bytes)
//package com.java2s; //License from project: Apache License public class Main { /**/*from w w w.j a v a 2 s .c o m*/ * * @param startWith The bytes to start with * @param bytes The bytes to test * @return */ public static boolean startWith(byte[] startWith, byte[] bytes) { if (bytes == null || startWith == null || bytes.length < startWith.length) { return false; } for (int i = 0; i < startWith.length; i++) { if (bytes[i] != startWith[i]) { return false; } } return true; } }