public static void Write(Stream stream, Itc itc) { BinaryMapping.WriteObject <Header>(stream, itc.header); for (int i = 0; i < itc.header.ItemsTotal; i++) { BinaryMapping.WriteObject <ITCData>(stream, itc.AllITC[i]); } }
public static Itc Read(Stream stream) { Itc itc = new Itc(); itc.header = BinaryMapping.ReadObject <Header>(stream); itc.AllITC = new List <ITCData>(); for (int i = 0; i < itc.header.ItemsTotal; i++) { itc.AllITC.Add(BinaryMapping.ReadObject <ITCData>(stream)); } return(itc); }