Here you can find the source of toPrimitive(Byte[] objectArray)
public static byte[] toPrimitive(Byte[] objectArray)
//package com.java2s; //License from project: Open Source License public class Main { public static byte[] toPrimitive(Byte[] objectArray) { byte[] primitiveArray = new byte[objectArray.length]; for (int i = 0; i < objectArray.length; i++) primitiveArray[i] = objectArray[i]; return primitiveArray; }/*ww w .j av a 2s . co m*/ public static int[] toPrimitive(Integer[] objectArray) { int[] primitiveArray = new int[objectArray.length]; for (int i = 0; i < objectArray.length; i++) primitiveArray[i] = objectArray[i]; return primitiveArray; } public static double[] toPrimitive(Double[] objectArray) { double[] primitiveArray = new double[objectArray.length]; for (int i = 0; i < objectArray.length; i++) primitiveArray[i] = objectArray[i]; return primitiveArray; } public static long[] toPrimitive(Long[] objectArray) { long[] primitiveArray = new long[objectArray.length]; for (int i = 0; i < objectArray.length; i++) primitiveArray[i] = objectArray[i]; return primitiveArray; } public static float[] toPrimitive(Float[] objectArray) { float[] primitiveArray = new float[objectArray.length]; for (int i = 0; i < objectArray.length; i++) primitiveArray[i] = objectArray[i]; return primitiveArray; } }