我有一个二维字节数组,想从一维数组中更新/复制每个数据数组。
var multi = new byte[5, 200];
var single0 = new byte[200]; // initialized to some data
var single1 = new byte[200]; // initialized to some data
var single2 = new byte[200]; // initialized to some data
var single3 = new byte[200]; // initialized to some data
var single4 = new byte[200]; // initialized to some data
Buffer.BlockCopy(single0, 0, multi, 0, single0.Count());
Buffer.BlockCopy(single1, 0, multi, 1, single1.Count());
Buffer.BlockCopy(single2, 0, multi, 2, single2.Count());
Buffer.BlockCopy(single3, 0, multi, 3, single3.Count());
Buffer.BlockCopy(single4, 0, multi, 4, single4.Count());
但这并没有按预期工作。只有第一行被更新。
任何帮助表示赞赏。谢谢。