Jef*_*ado 18
这些足够吗?
IEnumerable<byte> firstThree = myArray.Take(3);
byte[] firstThreeAsArray = myArray.Take(3).ToArray();
List<byte> firstThreeAsList = myArray.Take(3).ToList();
Run Code Online (Sandbox Code Playgroud)
怎么样:
Byte byte1 = bytesInput[0];
Byte byte2 = bytesInput[1];
Byte byte3 = bytesInput[2];
Run Code Online (Sandbox Code Playgroud)
或者在数组中:
Byte[] threeBytes = new Byte[] { bytesInput[0], bytesInput[1], bytesInput[2] };
Run Code Online (Sandbox Code Playgroud)
要么:
Byte[] threeBytes = new Byte[3];
Array.Copy(bytesInput, threeBytes, 0, 3);
// not sure on the overload but its similar to this
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
12554 次 |
| 最近记录: |