Java FileOutputStream Write Byte Array writeBytesInFile(File f, String data)

Here you can find the source of writeBytesInFile(File f, String data)

Description

write Bytes In File

License

Open Source License

Declaration

public static void writeBytesInFile(File f, String data) throws FileNotFoundException, IOException 

Method Source Code

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

import java.io.*;

public class Main {
    public static void writeBytesInFile(String f, String data) throws FileNotFoundException, IOException {
        writeBytesInFile(new File(f), data.getBytes());
    }/*from   w w w.  j av  a  2  s  .com*/

    public static void writeBytesInFile(File f, String data) throws FileNotFoundException, IOException {
        writeBytesInFile(f, data.getBytes());
    }

    public static void writeBytesInFile(File f, byte[] data) throws FileNotFoundException, IOException {
        FileOutputStream fos = new FileOutputStream(f, false);
        fos.write(data);
        fos.close();
    }
}

Related

  1. writeBytes(int[] data, String filename)
  2. writeBytes(int[] data, String filename)
  3. writeBytes(String filename, byte[] bytes)
  4. writeBytes(String filename, byte[] data, int len)
  5. writeBytes(String filePath, boolean append, byte[] content)
  6. writeBytesSafely(File aFile, byte theBytes[])
  7. writeBytesToFile(byte[] bfile, String filePath, String fileName)
  8. writeBytesToFile(byte[] byteContent, String fileName)
  9. writeBytesToFile(byte[] bytes, File file)