Java tutorial
//package com.java2s; import java.util.ArrayList; public class Main { public static ArrayList<Byte> toByteArray(byte[] data) { ArrayList<Byte> rval = new ArrayList<>(data.length); for (int i = 0; i < data.length; i++) { rval.add(i, new Byte(data[i])); } return rval; } }