Java Array Create ArrayToObject(byte[] values)

Here you can find the source of ArrayToObject(byte[] values)

Description

Array To Object

License

Open Source License

Declaration

public static Object[] ArrayToObject(byte[] values) 

Method Source Code

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

public class Main {
    public static Object[] ArrayToObject(byte[] values) {
        Object[] objects = new Object[values.length];

        for (int i = 0; i < values.length; i++) {
            objects[i] = values[i];/*from   w  ww  .  j av a  2 s .c  om*/
        }

        return objects;
    }

    public static Object[] ArrayToObject(char[] values) {
        Object[] objects = new Object[values.length];

        for (int i = 0; i < values.length; i++) {
            objects[i] = values[i];
        }

        return objects;
    }

    public static Object[] ArrayToObject(short[] values) {
        Object[] objects = new Object[values.length];

        for (int i = 0; i < values.length; i++) {
            objects[i] = values[i];
        }

        return objects;
    }

    public static Object[] ArrayToObject(int[] values) {
        Object[] objects = new Object[values.length];

        for (int i = 0; i < values.length; i++) {
            objects[i] = values[i];
        }

        return objects;
    }

    public static Object[] ArrayToObject(long[] values) {
        Object[] objects = new Object[values.length];

        for (int i = 0; i < values.length; i++) {
            objects[i] = values[i];
        }

        return objects;
    }

    public static Object[] ArrayToObject(float[] values) {
        Object[] objects = new Object[values.length];

        for (int i = 0; i < values.length; i++) {
            objects[i] = values[i];
        }

        return objects;
    }

    public static Object[] ArrayToObject(double[] values) {
        Object[] objects = new Object[values.length];

        for (int i = 0; i < values.length; i++) {
            objects[i] = values[i];
        }

        return objects;
    }
}

Related

  1. arrayOf(int... values)
  2. arrayOf(long... values)
  3. arrayOf(T... elements)
  4. arrayOf(T... objects)
  5. ArrayToArray(Integer obj, Integer[] objArray)
  6. newArray()
  7. newArray(Class elementType, int length)
  8. newArray(int length, double start, double increment)
  9. newArray(Object obj, int size)