How to convert byte[]
to Byte[]
and also Byte[]
to byte[]
, in the case of not using any 3rd party library?
Is there a way to do it fast just using the standard library?
byte[] to Byte[] :
byte[] bytes = ...;
Byte[] byteObject = ArrayUtils.toObject(bytes);
Byte[] to byte[] :
Byte[] byteObject = new Byte[0];
byte[] bytes = ArrayUtils.toPrimitive(byteObject);