Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
サイズが 4096 のバイト配列があると仮定すると、たとえばパターンに一致する 5 バイトのチャンクの開始位置を取得する効率的な方法は何ですか?
たとえば、バイト配列の最初の可能な一致の開始位置を取得したいと思います
var match = new byte[] { 0x03, 0x04, 0x05, 0x06, 0x07 };
したがって、上記のチャンクがバイト配列内で見つかった場合、最初のバイト (0x03) の位置が返されます。