예제 #1
0
        [Fact] public unsafe void Extractor_StructToBytesArray_Test()
        {
            byte[] b     = rcobj.GetStructureBytes();
            bool   equal = b.BlockEqual(structBytes);

            Assert.True(equal);
            object ro = rcobj;

            structBytes2 = new byte[rcobj.GetSize()];
            Extractor.StructureToBytes(ro, ref structBytes2, 0);
            bool equal2 = structBytes2.BlockEqual(structBytes);

            Assert.True(equal2);
        }
예제 #2
0
 public unsafe static void StructureTo(this object structure, ref byte[] binary, long offset = 0)
 {
     Extractor.StructureToBytes(structure, ref binary, offset);
 }