Java FileOutputStream Create writeFile(List data, String filename)

Here you can find the source of writeFile(List data, String filename)

Description

write File

License

Open Source License

Declaration

public static void writeFile(List<Byte> data, String filename) 

Method Source Code


//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);
        }
    }
}

Related

  1. writeFile(InputStream inputStream, String filename, long lastModified)
  2. writeFile(InputStream is, File file)
  3. writeFile(InputStream is, File outFile)
  4. writeFile(InputStream srcStream, File destFile)
  5. writeFile(InputStream stream, File to)
  6. writeFile(String directoryPath, String filename, byte[] bytes)
  7. writeFile(String f, String s)
  8. writeFile(String file, byte[]... data)
  9. writeFile(String file, byte[]... data)