BitConverter 异常,目标数组太小

BitConverter Exception, the destination array is too small

创建起来非常简单。我有一个简单的字节数组,证明它在运行时有数据:

那我就干脆

var bytedata = BitConverter.ToUInt32(byte_array,0);

它可以编译,但我在运行时收到一个 Argument Exception 提示目标数组太小。

来自微软 msdn 文档:

byte[] bytes = { 0, 0, 0, 25 };
int i = BitConverter.ToInt32(bytes, 0);

https://msdn.microsoft.com/en-us/library/bb384066.aspx

整数(在 C# 中)的大小是 4 个字节。您至少需要 4 个字节才能使转换成功。样本显示只有3个。

(不确定为什么消息说“目标数组”。而是“”。)