Return true if the byte array on the right is a prefix of the byte array on the left.
(byte[] bytes, byte[] prefix)
| 1042 | * the left. |
| 1043 | */ |
| 1044 | public static boolean startsWith(byte[] bytes, byte[] prefix) { |
| 1045 | return bytes != null && prefix != null && bytes.length >= prefix.length |
| 1046 | && compareTo(bytes, 0, prefix.length, prefix, 0, prefix.length) == 0; |
| 1047 | } |
| 1048 | |
| 1049 | /** |
| 1050 | * @param b |