Here you can find the source of toObjectArray(byte[] array)
public static Byte[] toObjectArray(byte[] array)
//package com.java2s; //License from project: Apache License public class Main { public static Byte[] toObjectArray(byte[] array) { if (array == null) { return null; } else {//from ww w. j a va2 s . c o m Byte[] result = new Byte[array.length]; for (int i = 0; i < array.length; i++) { result[i] = array[i]; } return result; } } public static Short[] toObjectArray(short[] array) { if (array == null) { return null; } else { Short[] result = new Short[array.length]; for (int i = 0; i < array.length; i++) { result[i] = array[i]; } return result; } } public static Integer[] toObjectArray(int[] array) { if (array == null) { return null; } else { Integer[] result = new Integer[array.length]; for (int i = 0; i < array.length; i++) { result[i] = array[i]; } return result; } } public static Long[] toObjectArray(long[] array) { if (array == null) { return null; } else { Long[] result = new Long[array.length]; for (int i = 0; i < array.length; i++) { result[i] = array[i]; } return result; } } public static Float[] toObjectArray(float[] array) { if (array == null) { return null; } else { Float[] result = new Float[array.length]; for (int i = 0; i < array.length; i++) { result[i] = array[i]; } return result; } } public static Double[] toObjectArray(double[] array) { if (array == null) { return null; } else { Double[] result = new Double[array.length]; for (int i = 0; i < array.length; i++) { result[i] = array[i]; } return result; } } public static Character[] toObjectArray(char[] array) { if (array == null) { return null; } else { Character[] result = new Character[array.length]; for (int i = 0; i < array.length; i++) { result[i] = array[i]; } return result; } } public static Boolean[] toObjectArray(boolean[] array) { if (array == null) { return null; } else { Boolean[] result = new Boolean[array.length]; for (int i = 0; i < array.length; i++) { result[i] = array[i]; } return result; } } }