public override void Flush() { try { _writer.Flush(); } catch { _currentState = State.Error; throw; } }