Searching for a sequence of Bytes in a Binary File with Java
No, there is no built-in method to do that. But, directly copied from HERE (with two fixes applied to the original code): /** * Knuth-Morris-Pratt Algorithm for Pattern Matching */ class KMPMatch { /** * Finds the first occurrence of the pattern in the text. */ public static int indexOf(byte[] data, byte[] pattern) { if … Read more