Java FileOutputStream Write saveFile(String fileName, byte[] bytes)

Here you can find the source of saveFile(String fileName, byte[] bytes)

Description

save File

License

Open Source License

Declaration

public static void saveFile(String fileName, byte[] bytes) 

Method Source Code


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

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class Main {
    public static void saveFile(String fileName, byte[] bytes) {
        try {//from   w w  w.  jav  a2s .  co m
            FileOutputStream fos = new FileOutputStream(fileName, true);
            fos.write(bytes);
            fos.flush();
            fos.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

Related

  1. saveFile(String content, String path)
  2. saveFile(String desEncryptTempFile, byte[] text)
  3. saveFile(String destinationFile, String contents)
  4. saveFile(String dir, String fileName, String data)
  5. saveFile(String file, String text)
  6. saveFile(String filename, byte[] content)
  7. saveFile(String fileName, byte[] data)
  8. saveFile(String fileName, InputStream stream)
  9. saveFile(String filename, String content)