Java - Byte[] to byte[]
byte[] toPrimitives(Byte[] oBytes){ byte[] bytes = new byte[oBytes.length]; for(int i = 0; i < oBytes.length; i++) { bytes[i] = oBytes[i]; } return bytes;}
Inverse:
// byte[] to Byte[]Byte[] toObjects(byte[] bytesPrim) { Byte[] bytes = new Byte[bytesPrim.length]; int i = 0; for (byte b : bytesPrim) bytes[i++] = b; // Autoboxing return bytes;}
freeone3000 contributed in this answer :)