Search code examples
binaryuint

C# BinaryReader read uint8


How to read uint8 from binary file? From BinaryReader tried already ReadUint16/32 not working for this And uchart too, cant find way to read these two. Any ideas?


Solution

  • C#'s implementation of "uint8" is Byte, while "int8" is SByte.

    BinaryReader has a ReadByte() method to read bytes.

    BinaryReader also has a ReadChar() method.

    Getting familiar with a language/framework's documention is a key skill to develop. In this case, MSDN C#.