Java FileOutputStream Write saveBytes(String filename, byte[] bytes)

Here you can find the source of saveBytes(String filename, byte[] bytes)

Description

save Bytes

License

Open Source License

Declaration

public static void saveBytes(String filename, byte[] bytes) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;

public class Main {
    public static void saveBytes(String filename, byte[] bytes) {
        try {//from   ww w  . j  ava2s  .c  o  m
            BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(new File(filename)));
            out.write(bytes);
            out.close();
        } catch (Exception exception) {
            exception.printStackTrace();
        }
    }
}

Related

  1. saveBytes(byte[] b, File destFolder, String fileName, String suffix)
  2. saveBytes(byte[] bytes, File file)
  3. saveBytes(File f, byte[] content)
  4. saveBytes(File file, byte[] bytes)
  5. saveBytes(String filename, byte[] byteData)
  6. saveBytes(String filename, byte[] data)
  7. saveBytes(String filename, byte[] data)
  8. saveBytesToFile(byte[] bytes, File file)
  9. saveBytesToFile(byte[] bytes, File file)