public override void Write(byte[] array, int offset, int count)
{
// Validate the state and the parameters
EnsureCompressionMode();
ValidateParameters(array, offset, count);
EnsureNotDisposed();
DoMaintenance(array, offset, count);
// Write compressed the bytes we already passed to the deflater:
WriteDeflaterOutput();
// Pass new bytes through deflater and write them too:
_deflater.SetInput(array, offset, count);
WriteDeflaterOutput();
}