Java 8 solution:
Byte[] toObjects(byte[] bytesPrim) { Byte[] bytes = new Byte[bytesPrim.length]; Arrays.setAll(bytes, n -> bytesPrim[n]); return bytes; }
Unfortunately, you cannot do this to convert from Byte[] to Byte[] . Arrays has setAll for double[] , int[] and long[] , but not for other primitive types.
ajb Jun 16 '14 at 10:50 2014-06-16 22:50
source share