List of utility methods to do Array Primitive to Object Convert
Integer[] | wrap(int[] value) Converts an array of int into an array of Integer . if (value == null) return null; Integer[] res = new Integer[value.length]; for (int i = 0; i < value.length; i++) { res[i] = Integer.valueOf(value[i]); return res; |
Long[] | wrap(long[] value) Converts an array of long into an array of Long . if (value == null) return null; Long[] res = new Long[value.length]; for (int i = 0; i < value.length; i++) { res[i] = Long.valueOf(value[i]); return res; |
Byte[] | convertToObjectArray(byte[] bytes) convert To Object Array final Byte[] objects = new Byte[bytes.length]; for (int i = 0; i < bytes.length; i++) { objects[i] = Byte.valueOf(bytes[i]); return objects; |
byte[] | convertToPrimitiveArray(Byte[] objects) convert To Primitive Array final byte[] bytes = new byte[objects.length]; for (int i = 0; i < objects.length; i++) { bytes[i] = objects[i].byteValue(); return bytes; |