converting an array of bytes to List<Byte>
Library Apache Commons Lang has ArrayUtils.toObject, which turns a primitive array to a typed object array:
int array[] = { 1, 2, 3 };
List<Integer> list = Arrays.asList(ArrayUtils.toObject(array));
For Byte[]
instead of byte[]
this would work:
Byte[] array = ....
List<Byte> list = Arrays.asList(array);
As this post suggests: the guava Bytes class can help out:
byte[] bytes = ...
List<Byte> byteList = Bytes.asList(bytes);