爲什麼C#Marshal.Copy例程沒有任何過載從非託管內存指針複製到16位管理無符號整數數組?C#Marshal.Copy Intptr到16位管理無符號整數數組
例如:
Copy(IntPtr, Byte[], Int32, Int32) Copies data from an unmanaged memory pointer to a managed 8-bit unsigned integer array.
Copy(IntPtr, Char[], Int32, Int32) Copies data from an unmanaged memory pointer to a managed character array.
Copy(IntPtr, Double[], Int32, Int32) Copies data from an unmanaged memory pointer to a managed double-precision floating-point number array.
Copy(IntPtr, Int16[], Int32, Int32) Copies data from an unmanaged memory pointer to a managed 16-bit signed integer array.
Copy(IntPtr, Int32[], Int32, Int32) Copies data from an unmanaged memory pointer to a managed 32-bit signed integer array.
Copy(IntPtr, Int64[], Int32, Int32) Copies data from an unmanaged memory pointer to a managed 64-bit signed integer array.
Copy(IntPtr, IntPtr[], Int32, Int32) Copies data from an unmanaged memory pointer to a managed IntPtr array.
Copy(IntPtr, Single[], Int32, Int32). Copies data from an unmanaged memory pointer to a managed single-precision floating-point number array.
如果沒有編組的替代,如何複製非託管USHORT陣列管理USHORT陣列?
VB.NET確實具有無符號類型複製支持,你只需要指定類型名稱而不是語言別名,例如'昏暗的foo作爲UInt16'。 – Dai
@dai好吧,我會從我的答案中刪除。 – doug65536
(Int16 [])給出類型轉換錯誤。這是我想要做的:http://stackoverflow.com/questions/28595903/copy-from-intptr-16-bit-array-to-managed-ushort –