示例#1
0
 /// <summary>
 /// To work with native data via byte-array.
 /// </summary>
 /// <param name="bytes">local raw data.</param>
 /// <returns></returns>
 public static NativeData Native(this byte[] bytes)
 {
     return(NativeData._(bytes));
 }
示例#2
0
 /// <summary>
 /// Alias to `NativeData.SizeOf ...`
 /// Gets size of selected type in bytes that's should be considered as unmanaged type.
 /// </summary>
 /// <param name="type"></param>
 /// <returns></returns>
 public static int NativeSize(this Type type)
 {
     return(NativeData.SizeOf(type));
 }
示例#3
0
 /// <summary>
 /// To work with native data via pointer.
 /// </summary>
 /// <param name="ptr">pointer to data structure.</param>
 /// <returns></returns>
 public static NativeData Native(this IntPtr ptr)
 {
     return(NativeData._(ptr));
 }