Best approach to write/read binary data in Little or Big Endian with C#?

冷暖自知 提交于 2020-01-13 13:11:10

问题


Ok, if i've got a binary file encoded either in little endian or big endian under .NET, what is the best way to read / write to it?

In the .NET framework i've only managed to found BinaryWritters / BinaryReaders which use little endian as default, so my approach was implement my own BinaryReader / BinaryWritter for reading / writting data in big endian, but I wonder if there is a better aproach.


回答1:


I like this one:

Miscellaneous Utility Library



来源:https://stackoverflow.com/questions/80784/best-approach-to-write-read-binary-data-in-little-or-big-endian-with-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!