I have a byte array and I would like to get values from it into variables. I know the values format like string, unsigned int etc.
byte[] buffer = File.ReadAllBytes("binarydata.bin");
string value1 = ???
uint16 value2 = ???
string value3 = ???
uint32 value4 = ???
How can i assign the values? I know that the first value is a string of 8, i know the second value is a usigned 16bit int, and the third value is a string of 12 and the forth is a unsigned 32 bit int.
BitConverterclassBinaryReaderorBitConverter.stringvalue will need some metadata to be present in the file to indicate the length of the string. (Usually length prefixed, but who knows?)