[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); }
public unsafe static void StructureTo(this object structure, ref byte[] binary, long offset = 0) { Extractor.StructureToBytes(structure, ref binary, offset); }