Here you can find the source of writeFile(List
public static void writeFile(List<Byte> data, String filename)
//package com.java2s; //License from project: Open Source License import java.io.*; import java.util.List; public class Main { public static void writeFile(List<Byte> data, String filename) { try (FileOutputStream file = new FileOutputStream(filename)) { byte[] bytes = new byte[data.size()]; for (int i = 0; i < bytes.length; i++) bytes[i] = data.get(i);//from w w w. j a va 2 s. c o m file.write(bytes); } catch (IOException e) { throw new RuntimeException(e); } } }