Here you can find the source of toObjectArray(boolean arr[])
public static Boolean[] toObjectArray(boolean arr[])
//package com.java2s; /**//from ww w . j av a 2 s . c om * JLibs: Common Utilities for Java * Copyright (C) 2009 Santhosh Kumar T <santhosh.tekuri@gmail.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. */ public class Main { public static Boolean[] toObjectArray(boolean arr[]) { if (arr == null) return null; Boolean result[] = new Boolean[arr.length]; for (int i = arr.length - 1; i >= 0; i--) result[i] = arr[i]; return result; } public static Character[] toObjectArray(char arr[]) { if (arr == null) return null; Character result[] = new Character[arr.length]; for (int i = arr.length - 1; i >= 0; i--) result[i] = arr[i]; return result; } public static Byte[] toObjectArray(byte arr[]) { if (arr == null) return null; Byte result[] = new Byte[arr.length]; for (int i = arr.length - 1; i >= 0; i--) result[i] = arr[i]; return result; } public static Short[] toObjectArray(short arr[]) { if (arr == null) return null; Short result[] = new Short[arr.length]; for (int i = arr.length - 1; i >= 0; i--) result[i] = arr[i]; return result; } public static Integer[] toObjectArray(int arr[]) { if (arr == null) return null; Integer result[] = new Integer[arr.length]; for (int i = arr.length - 1; i >= 0; i--) result[i] = arr[i]; return result; } public static Long[] toObjectArray(long arr[]) { if (arr == null) return null; Long result[] = new Long[arr.length]; for (int i = arr.length - 1; i >= 0; i--) result[i] = arr[i]; return result; } public static Float[] toObjectArray(float arr[]) { if (arr == null) return null; Float result[] = new Float[arr.length]; for (int i = arr.length - 1; i >= 0; i--) result[i] = arr[i]; return result; } public static Double[] toObjectArray(double arr[]) { if (arr == null) return null; Double result[] = new Double[arr.length]; for (int i = arr.length - 1; i >= 0; i--) result[i] = arr[i]; return result; } }