diff --git a/ClosedXML/ClosedXML/ClosedXML_Tests/Utils/StreamHelper.cs b/ClosedXML/ClosedXML/ClosedXML_Tests/Utils/StreamHelper.cs index b5d4062..30b8d08 100644 --- a/ClosedXML/ClosedXML/ClosedXML_Tests/Utils/StreamHelper.cs +++ b/ClosedXML/ClosedXML/ClosedXML_Tests/Utils/StreamHelper.cs @@ -105,7 +105,7 @@ } /// - /// Compare two streams by looping + /// Compare two streams by converting them to strings and comparing the strings /// /// /// @@ -133,18 +133,9 @@ #endregion - if (one.Length != other.Length) - { - return false; - } - int _oneByte; - int _otherByte; - do - { - _oneByte = one.ReadByte(); - _otherByte = other.ReadByte(); - } while (_oneByte == _otherByte && !(_oneByte == -1 || _otherByte == -1)); - return _oneByte == -1 && _otherByte == -1; + var stringOne = new StreamReader(one).ReadToEnd(); + var stringOther = new StreamReader(other).ReadToEnd(); + return stringOne == stringOther; } } } \ No newline at end of file