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