Java FileOutputStream Write Byte Array writeBytes(File aFile, byte theBytes[])

Here you can find the source of writeBytes(File aFile, byte theBytes[])

Description

Writes the given bytes (within the specified range) to the given file.

License

Open Source License

Declaration

public static void writeBytes(File aFile, byte theBytes[]) throws IOException 

Method Source Code


//package com.java2s;
import java.io.*;

public class Main {
    /**/*from  ww  w  . j  av a2  s.c o m*/
     * Writes the given bytes (within the specified range) to the given file.
     */
    public static void writeBytes(File aFile, byte theBytes[]) throws IOException {
        if (theBytes == null) {
            aFile.delete();
            return;
        }
        FileOutputStream fileStream = new FileOutputStream(aFile);
        fileStream.write(theBytes);
        fileStream.close();
    }
}

Related

  1. writeBytes(byte[] bytes, String file)
  2. writeBytes(byte[] data, File file)
  3. writeBytes(File dest, byte[] data, int off, int len, boolean append)
  4. writeBytes(File f, byte[] b)
  5. writeBytes(File f, byte[] data)
  6. writeBytes(File file, byte[] arr)