Reputation: 56249
How do I append the elements of a byte[]
to a List<Byte>
?
Upvotes: 3
Views: 2415
Reputation: 110104
Using Guava, you could use Bytes.asList(byte...) like this:
List<Byte> list = ...
byte[] bytes = ...
list.addAll(Bytes.asList(bytes));
Upvotes: 5
Reputation: 49237
Is this what you're looking for?
for(byte b : byte) {
list.add(b);
}
Upvotes: 8