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.
每次我得到4 byte[] data. 我有一个byte [] container。我想将这些即将到来的数据附加到容器的末尾。有没有时间有效的方法来做到这一点?我不知道会有多少 4 字节数据,所以我不知道容器的最终大小
4 byte[] data
byte [] container
只需使用ArrayList而不关心这个(ArrayList 会处理增加数组)。您可以随时将其转换为byte[]以后。
ArrayList
byte[]