예제 #1
0
        public static int IntPtrToInt16(IntPtr pointerInt, int byteLength = 2)
        {
            byte[] destinationData = new byte[byteLength];
            Marshal.Copy(pointerInt, destinationData, 0, byteLength);//将数据从非托管内存指针复制到托管 8 位无符号整数数组。
            int ret = ByteHelper.ByteToInt32(destinationData);

            return(ret);
        }