Here you can find the source of saveFile(String fileName, byte[] data)
Parameter | Description |
---|---|
fileName | a parameter |
public static void saveFile(String fileName, byte[] data)
//package com.java2s; import java.io.FileOutputStream; import java.io.OutputStream; public class Main { /**//from w ww . j a va2s .c om * Convenience method to save a file * @param fileName */ public static void saveFile(String fileName, byte[] data) { try { OutputStream out = new FileOutputStream(fileName); out.write(data); out.close(); } catch (Exception e) { System.out.println("Cannot save file. " + e.getMessage()); } System.out.println("Have save file of: " + data.length + " bytes."); } }