List of utility methods to do Array Starts With
boolean | startsWith(char[] str1, String str2) Returns true if a prefix of the character array is the same as contents of a string. int len = str2.length(); if (str1.length < len) return false; for (int i = 0; i < len; i++) { if (str1[i] != str2.charAt(i)) { return false; return true; |
boolean | startsWith(final byte[] array, final byte[] prefix) starts With if (array == null) return false; if (prefix == null) return false; if (prefix.length > array.length) return false; for (int i = 0; i < prefix.length; i++) if (array[i] != prefix[i]) ... |
boolean | startsWith(final byte[] str, int startIndex, int endIndex, final byte ch) starts With if (startIndex < 0) { startIndex = 0; if (endIndex > str.length) { endIndex = str.length; return (startIndex < endIndex) && (str[startIndex] == ch); |
boolean | startsWithGaps(final byte[] aFrag, final int numStartGaps) starts With Gaps for (int i = 0; i < numStartGaps; i++) { if (i >= aFrag.length) { return true; if (!isGap(aFrag[i])) { return false; return true; |
boolean | startsWithZipMagicBytes(byte[] data) Returns whether the given bytes start with the magic bytes that mark a ZIP file. return isPrefix(new byte[] { 0x50, 0x4b, 0x03, 0x04 }, data); |