private void StripPreamble(byte[] buffer, ref int offset, ref int count)
{
if (_preambleToStrip != null && count >= _preambleToStrip.Length)
{
for (int idx = 0; idx < _preambleToStrip.Length; idx++)
{
if (_preambleToStrip[idx] != buffer[idx])
{
_preambleToStrip = null;
return;
}
}
offset += _preambleToStrip.Length;
count -= _preambleToStrip.Length;
}
_preambleToStrip = null;
}