4
Answers

Read data into structs?

franny

franny

20y
2k
1
I would like to use the System.IO class to read binary data directly into some c# structs. But I dont see a way to do it. All the readers that I know of ( BinaryReader, StreamReader) want a byte[] or char[] as the target buffer. I dont see a way to cast my struct into a byte[] so I can use these read methods. Does anyone have a solution for this? Thanks in advance.
Answers (4)