For those who might be interested in this in the future, instead consider reading the whole file and do as explained by @stevengj here:
Finding position of a sequence in a UInt8 array?
This will do 1 allocation, which is better than the about 20ish I got before
Kind regards