Java tutorial
//package com.java2s; import java.util.List; public class Main { public static byte[] toByteArray(List<Byte> list) { byte[] ret = new byte[list.size()]; for (int i = 0; i < ret.length; i++) ret[i] = list.get(i); return ret; } }