Spent ~30 "quality" minutes trying to figure out how to find a sequence of bytes in another sequence of bytes… in #Java.
- "just copy-paste this Knuth-Morris-Pratt implementation" (you're kidding me?)
- "just convert to String and use .indexOf" (ever seen non-ascii bytes?)
- "just use Google Guava" (whatever that is)
Turns out, there is a way… But first I have to think of my ByteBuffer as of byte array, then that as of List, and *then* I have Collections.indexOfSubList.
Server run by the main developers of the project It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!