Be.IO
Be.IO copied to clipboard
BeBinaryReader::ReadInt64() seems to be broken
Writing a long value with BeBinaryWriter and reading it back with BeBinaryReader::ReadInt64() will not give the same value. (While the same test with standard BinaryWriter/BinaryReader works as expected) I suspect that reading is broken just based on what I see in BigEndian.cs source file. BigEndian::WriteInt64() looks straightforward, but BigEndian::ReadInt64() is using more complex (and apparently erroneous) transformations.
Oh, it turns out that there is a pull request fixing this issue from the year 2016. Any chance it will get merged some day?
BUMP
Also encountering multiple issues while testing the BeBinaryReader:
After merging 2 pending PRs, it looks like all features are working as expected.
For smaller numeric types (short
, int
, etc.), I for
ed the entire range. For larger samples I tested edge cases (min & max) and 10 RNGed numbers each. I also ran the larger tests multiple times to cover more cases.
All tests are done roundtrip: arbitrary data → Writer
→ file → processed read-only by external HEX editor → Reader
→ assertion against original data.