Java File Object Create toFile(byte[] bFile)

Here you can find the source of toFile(byte[] bFile)

Description

to File

License

Apache License

Declaration

public static void toFile(byte[] bFile) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.*;

public class Main {
    public static void toFile(byte[] bFile) {

        try {/* w  w  w  .  ja v  a2  s.  c o  m*/
            //convert file into array of bytes

            //convert array of bytes into file
            FileOutputStream fileOuputStream = new FileOutputStream("C:\\testing2.png");
            fileOuputStream.write(bFile);
            fileOuputStream.close();

            System.out.println("Done");
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

Related

  1. toFile(Class cls)
  2. toFile(File baseDir, String path)
  3. toFile(File currentDirectory, String file)
  4. toFile(File dir, String[] path)