Java Object Create toObject(byte[] primitiveArray)

Here you can find the source of toObject(byte[] primitiveArray)

Description

to Object

License

Open Source License

Declaration

public static Byte[] toObject(byte[] primitiveArray) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static Byte[] toObject(byte[] primitiveArray) {
        Byte[] objectArray = new Byte[primitiveArray.length];
        for (int i = 0; i < primitiveArray.length; i++)
            objectArray[i] = primitiveArray[i];

        return objectArray;
    }/*w w  w  .  ja v  a 2 s  .  c o m*/

    public static Integer[] toObject(int[] primitiveArray) {
        Integer[] objectArray = new Integer[primitiveArray.length];
        for (int i = 0; i < primitiveArray.length; i++)
            objectArray[i] = primitiveArray[i];

        return objectArray;
    }

    public static Double[] toObject(double[] primitiveArray) {
        Double[] objectArray = new Double[primitiveArray.length];
        for (int i = 0; i < primitiveArray.length; i++)
            objectArray[i] = primitiveArray[i];

        return objectArray;
    }

    public static Long[] toObject(long[] primitiveArray) {
        Long[] objectArray = new Long[primitiveArray.length];
        for (int i = 0; i < primitiveArray.length; i++)
            objectArray[i] = primitiveArray[i];

        return objectArray;
    }

    public static Float[] toObject(float[] primitiveArray) {
        Float[] objectArray = new Float[primitiveArray.length];
        for (int i = 0; i < primitiveArray.length; i++)
            objectArray[i] = primitiveArray[i];

        return objectArray;
    }
}

Related

  1. as(Object value, Class c)
  2. as(Object value, Class type)
  3. toObject(boolean[] array)
  4. toObject(byte[] array)
  5. toObject(byte[] byteArray)
  6. toObject(Class clazz, String value)
  7. toObject(double[] a)
  8. toObject(final int i)
  9. toObject(int[] array)