private void EnsureBufferSpace(int required)
{
// is there room in the buffer?
if (this._outputBufferPos + required >= this._outputBuffer.Length)
{
// flush the initial section
int startWindowOffset = this._outputBufferPos - MAX_WIN;
FlushOutputBufferSection(startWindowOffset); // only flush the section that's not part of the window
// position the stream further back
Buffer.BlockCopy(this._outputBuffer, startWindowOffset, this._outputBuffer, 0, MAX_WIN);
this._outputBufferPos = MAX_WIN;
}
}