Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的问题是我像这样发送到外部设备字节数组: byte[] dataBuffer = new Byte[9] {1, 2, 3, 4, 5, 6, 7, 8, 9}; 但是当我在那里读取这些字节时,当应该有 3 时,我得到例如 2。所以它始终是左值。数组的开头是否可能还有其他内容?空值?
byte[] dataBuffer = new Byte[9] {1, 2, 3, 4, 5, 6, 7, 8, 9};
字节数组是zero-indexed您可能将 dataBuffer[1] 视为第一个元素,但实际上您有 dataBuffer[0] 第一个元素。
zero-indexed