Java FileOutputStream Create writeFileData(File dataFile, String targetFile)

Here you can find the source of writeFileData(File dataFile, String targetFile)

Description

write File Data

License

Open Source License

Declaration

public static void writeFileData(File dataFile, String targetFile)
            throws IOException 

Method Source Code

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

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class Main {
    public static void writeFileData(File dataFile, String targetFile)
            throws IOException {
        FileInputStream istream = new FileInputStream(dataFile);
        FileOutputStream ostream = new FileOutputStream(targetFile);
        byte[] buffer = new byte[1024];
        int len = 0;
        while ((len = istream.read(buffer)) != -1) {
            ostream.write(buffer, 0, len);
        }//w  w w .j av a2s .c  om
        istream.close();
        ostream.close();
    }
}

Related

  1. writeFileByLine(String content, String filename, boolean append)
  2. writeFileBytes(File pFile, byte[] pBytes)
  3. writeFileContent(String filepath, byte[] content)
  4. writeFileContent(String sFileName, byte[] content)
  5. writeFileCover(String path, String content)
  6. writeFileData(File file, byte[] fileData)
  7. writeFileFromBytes(byte[] bytes, File file)
  8. writeFileFromStream(File tempFile, InputStream in)
  9. writeFileFromString(File outputFileName, String content)