public void Init( ) { BoolSlice = new List <bool>(); Int32Slice = new List <int>(); UInt32Slice = new List <uint>(); Int64Slice = new List <long>(); UInt64Slice = new List <ulong>(); Float32Slice = new List <float>(); Float64Slice = new List <double>(); StrSlice = new List <string>(); EnumSlice = new List <MyEnum>(); Struct = (MySubType)InputStream.CreateStruct(typeof(MySubType)); }
static void TestFull() { byte[] data = new byte[256]; var s = new OutputStream(data); var myType = MakeMyType(); s.Marshal(myType); var s2 = new InputStream(); s2.Init(data, 0, s.Position); var myType2 = InputStream.CreateStruct <MyType>(); s2.Unmarshal(myType2); Debug.Assert(myType.Equals(myType2)); }