开发者

DataInputStream.skip equivalent in C#

I am reading values from a byte array in a switch case, if none of the switch case matches, in the default I need to skip some number of by开发者_如何学Pythontes. In java it is achieved by using the DataInputStream class method skip(numberOfbytes). how can we do the same in c#?


Either use Stream.Seek or (my personal preference) use the Position property:

stream.Position += bytesToSkip;

That assumes you're dealing with a seekable stream of course.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜