问题描述
可以强制BinaryReader读取流,比如一个TCP / IP流或内存
流,甚至是big endian命令的文件流,还是我必须要写
自定义转换字节顺序的东西?所以,例如,我想要一个
Windows客户端PC(原生小端)能够读取网络流
作为大端进来。我希望能够阅读一个简短的例如
而不用担心翻转字节。
谢谢,
Laszlo
我相信OP正在谈论各种其他调用
BinaryReader:ReadInt16等,而不是读取字符串。
-
Jon Skeet - < sk *** @ pobox.com>
如果回复小组,请不要给我发邮件
Can BinaryReader be forced to read a stream, say a TCP/IP stream or memory
stream or even file stream in big endian order or do I have to write
something custom to reverse the byte order? So, for example, I''d like a
Windows client PC (native little endian) to be able to read a network stream
coming in as big endian. I want to be able to read a short for example
without worrying about flipping the bytes.
Thank you,
Laszlo
I believe the OP is talking about the various other calls to
BinaryReader: ReadInt16 etc, not reading strings.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
这篇关于BinaryReader - 可以强制读取BigEndian流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!