Array List of Byte to byte[] - Android java.util

Android examples for java.util:ArrayList

Description

Array List of Byte to byte[]

Demo Code


//package com.java2s;

import java.util.ArrayList;

public class Main {
    public static byte[] ArrayListToByte(ArrayList<Byte> list) {
        int iSize = list.size();
        byte[] arrData = new byte[iSize];
        for (int i = 0; i < iSize; i++) {
            Byte b = (Byte) list.get(i);
            arrData[i] = b.byteValue();/*  w  ww .j  ava2 s.  c  o  m*/
        }
        return arrData;
    }
}

Related Tutorials