List of utility methods to do Array Search
boolean | inArray(Object o, Object... arr) in Array for (Object object : arr) { if (o == object) return true; return false; |
int | indexOf(byte[] bytes, byte[] pattern, int start) Calculate the index of the first occurrence of the pattern in the byte array, starting with the given index. if (pattern.length == 0) { return start; if (start > bytes.length) { return -1; int last = bytes.length - pattern.length + 1; next: for (; start < last; start++) { ... |
int | indexOf(byte[] data, byte search) index Of int len = data.length; for (int i = 0; i < len; i++) { if (data[i] == search) { return i; return -1; |
int | indexof(byte[] shortBytes, byte[] longBytes) indexof for (int i = 0; i < longBytes.length; i++) { if (longBytes[i] == shortBytes[0] && longBytes.length - i >= shortBytes.length) { boolean isIndexof = true; for (int j = 1; j < shortBytes.length; j++) { if (shortBytes[j] != longBytes[i + j]) { isIndexof = false; continue; ... |