franny

franny

  • NA
  • 11
  • 0

Read data into structs?

Dec 5 2004 8:49 PM
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)