Java Write Byte Array to File writeFile(String fileName, byte[] data)

Here you can find the source of writeFile(String fileName, byte[] data)

Description

write File

License

Open Source License

Declaration

public static void writeFile(String fileName, byte[] data) throws FileNotFoundException, IOException 

Method Source Code

//package com.java2s;
/**/*from  w  w  w .  ja  v a  2s .c o  m*/
 * Copyright 2010 ZTEsoft Inc. All Rights Reserved.
 *
 * This software is the proprietary information of ZTEsoft Inc.
 * Use is subject to license terms.
 * 
 * $Tracker List
 * 
 * $TaskId: $ $Date: 9:24:36 AM (May 9, 2008) $comments: create 
 * $TaskId: $ $Date: 3:56:36 PM (SEP 13, 2010) $comments: upgrade jvm to jvm1.5 
 *  
 *  
 */

import java.io.*;

public class Main {

    public static void writeFile(String fileName, byte[] data) throws FileNotFoundException, IOException {
        File file = new File(fileName);
        FileOutputStream fs = new FileOutputStream(file);
        fs.write(data);
        fs.close();
    }
}

Related

  1. writeFile(String filename, byte data[])
  2. writeFile(String filename, byte[] bs)
  3. writeFile(String fileName, byte[] bytes)
  4. writeFile(String fileName, byte[] bytes)
  5. writeFile(String fileName, byte[] bytes)