开发者

How do I append a byte[] to a List<Byte>?

开发者 https://www.devze.com 2023-02-07 13:26 出处:网络
How do I append the 开发者_如何学运维elements of a byte[] to a List<Byte>?Is this what you\'re looking for?

How do I append the 开发者_如何学运维elements of a byte[] to a List<Byte>?


Is this what you're looking for?

for(byte b : byte) {
    list.add(b);
}


Using Guava, you could use Bytes.asList(byte...) like this:

List<Byte> list = ...
byte[] bytes = ...
list.addAll(Bytes.asList(bytes));
0

精彩评论

暂无评论...
验证码 换一张
取 消