Java Array Convert to convertArray(byte[] a)

Here you can find the source of convertArray(byte[] a)

Description

convert Array

License

Open Source License

Declaration

public static Byte[] convertArray(byte[] a) 

Method Source Code

//package com.java2s;

public class Main {
    public static Byte[] convertArray(byte[] a) {
        Byte[] ret = new Byte[a.length];
        for (int i = 0; i < a.length; i++) {
            ret[i] = a[i];//from  w w w  . ja  va 2 s. c  om
        }
        return ret;
    }

    public static Short[] convertArray(short[] a) {
        Short[] ret = new Short[a.length];
        for (int i = 0; i < a.length; i++) {
            ret[i] = a[i];
        }
        return ret;
    }

    public static Integer[] convertArray(int[] a) {
        Integer[] ret = new Integer[a.length];
        for (int i = 0; i < a.length; i++) {
            ret[i] = a[i];
        }
        return ret;
    }

    public static Long[] convertArray(long[] a) {
        Long[] ret = new Long[a.length];
        for (int i = 0; i < a.length; i++) {
            ret[i] = a[i];
        }
        return ret;
    }

    public static Float[] convertArray(float[] a) {
        Float[] ret = new Float[a.length];
        for (int i = 0; i < a.length; i++) {
            ret[i] = a[i];
        }
        return ret;
    }

    public static Double[] convertArray(double[] a) {
        Double[] ret = new Double[a.length];
        for (int i = 0; i < a.length; i++) {
            ret[i] = a[i];
        }
        return ret;
    }
}

Related

  1. arrayToSqlInList(String... values)
  2. arrayToSv(String as[], String s)
  3. arrayToSVMLightString(int[] array)
  4. arrayToUpper(String[] values)
  5. arrayWithoutFirstsElement(final String[] array, final int elementsToRemove)
  6. convertArray(Object columns[], int minLength)
  7. convertArray(String[] str)
  8. convertArray2String(String[] sources)
  9. convertArrayIndexToShipLetter(int i)