public static void SetWCharArrayRaw(_Array arr, object value) { MemoryView view = value as MemoryView; if ((object)view != null) { string strVal = view.tobytes().MakeString(); if (strVal.Length > arr.__len__()) { throw PythonOps.ValueError("string too long"); } value = strVal; } arr.NativeType.SetValue(arr._memHolder, 0, value); }
public static void SetWCharArrayRaw(_Array arr, object value) { PythonBuffer buf = value as PythonBuffer; if (buf != null && (buf._object is string || buf._object is Bytes)) { value = buf.ToString(); } MemoryView view = value as MemoryView; if ((object)view != null) { string strVal = view.tobytes().ToString(); if (strVal.Length > arr.__len__()) { throw PythonOps.ValueError("string too long"); } value = strVal; } arr.NativeType.SetValue(arr._memHolder, 0, value); }
public static Bytes hexlify(MemoryView data) { return(hexlify(data.tobytes())); }
public static Bytes a2b_uu(CodeContext /*!*/ context, [NotNull] MemoryView data) => a2b_uu_impl(context, data.tobytes());