Here you can find the source of fill(byte[] arr)
public static List<Byte> fill(byte[] arr)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public static byte[] fill(List<Byte> list) { if (list == null) { return new byte[0]; }//w ww . j a v a 2 s . co m int size = list.size(); byte[] arr = new byte[size]; for (int i = 0; i < size; i++) { arr[i] = list.get(i); } return arr; } public static List<Byte> fill(byte[] arr) { List<Byte> list = null; if (arr == null) { return new ArrayList<Byte>(0); } int size = arr.length; list = new ArrayList<Byte>(size); for (byte by : arr) { list.add(by); } return list; } }