public static byte[] FigToLz4Bin(CadFigure fig, bool withChild = false) { MpFigure_v1002 mpf = MpFigure_v1002.Create(fig, withChild); var lz4Options = MessagePackSerializerOptions.Standard.WithCompression(MessagePackCompression.Lz4BlockArray); return(MessagePackSerializer.Serialize(mpf, lz4Options)); }
public static void CopyTo(CadFigure src, CadFigure dst) { MpFigure_v1002 mpf = MpFigure_v1002.Create(src, false); byte[] data = MessagePackSerializer.Serialize(mpf); MpFigure_v1002 mpfCopy = MessagePackSerializer.Deserialize <MpFigure_v1002>(data); uint id = dst.ID; mpfCopy.RestoreTo(dst); dst.ID = id; }
public static byte[] FigToBin(CadFigure fig, bool withChild) { MpFigure_v1002 mpf = MpFigure_v1002.Create(fig, withChild); return(MessagePackSerializer.Serialize(mpf)); }