/// <summary> /// The NewStructure. /// </summary> /// <param name="structure">The structure<see cref="Type"/>.</param> /// <param name="binary">The binary<see cref="byte[]"/>.</param> /// <param name="offset">The offset<see cref="long"/>.</param> /// <returns>The <see cref="object"/>.</returns> public static object NewStructure(this Type structure, byte[] binary, long offset = 0) { //return _copier.PtrToStruct(binary, structure); // object o = Activator.CreateInstance(structure); return(Extractor.BytesToStructure(binary, structure, offset)); }
public unsafe static object ToStructure(this byte[] binary, object structure, long offset = 0) { return(Extractor.BytesToStructure(binary, structure, offset)); }
public unsafe static ValueType ToStructure(this byte[] binary, ValueType structure, long offset = 0) { return(Extractor.BytesToStructure(binary, structure, offset)); }
public static object NewStructure(this byte[] binary, Type structure, long offset = 0) { return(Extractor.BytesToStructure(binary, structure, offset)); }