public override void Close() { if (_writeState != null && WriteState.Length > 0) { _encoder.AppendPadding(); FlushInternal(); } base.Close(); }