static long indexOfBytesInFile(File f, byte[] data) ctex { int b, l = l(data); CircularByteBuffer buf = new(l); temp BufferedInputStream in = bufferedFileInputStream(f); long counter = 0; bigLoop: while ((b = in.read()) >= 0) { buf.add((byte) b); ++counter; if (buf.size() >= l) { long start = counter-l; for i to l: { if (buf.get(start+i) != data[i]) continue bigLoop; } ret start; } } ret -1; }