public void InsertBytes(byte[] buffer, int offset, int count)
{
DiagnosticUtility.DebugAssert(_stream != null, "");
if (_offsetMax > buffer.Length - count)
{
byte[] newBuffer = new byte[_offsetMax + count];
System.Buffer.BlockCopy(_buffer, 0, newBuffer, 0, _offsetMax);
_buffer = newBuffer;
_streamBuffer = newBuffer;
}
System.Buffer.BlockCopy(_buffer, _offset, _buffer, _offset + count, _offsetMax - _offset);
_offsetMax += count;
System.Buffer.BlockCopy(buffer, offset, _buffer, _offset, count);
}