Read stream into structure from System.IO

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Enosh Chang

    #1

    Read stream into structure from System.IO

    Hi,

    I encounter one problem about System.IO. I have a binary file that contains
    following structure,

    struct MyFormat
    {
    public sbyte Type;
    public sbyte[] Num;
    public sbyte Flag;
    public sbyte[] Name;
    }

    Question 1: How can I assign the length of Num to 5, such as "public
    sbyte[15] Num;" like C++?
    Question 2: How can I read this binary file into structure one by one?

    Thanks!!



Working...