Java FileOutputStream Write Byte Array writeBytes(File outputFile, byte[] bytes)

Here you can find the source of writeBytes(File outputFile, byte[] bytes)

Description

write Bytes

License

Open Source License

Declaration

public static void writeBytes(File outputFile, byte[] bytes) throws IOException 

Method Source Code

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

import java.io.File;

import java.io.FileOutputStream;
import java.io.IOException;

public class Main {
    public static void writeBytes(File outputFile, byte[] bytes) throws IOException {
        outputFile.getParentFile().mkdirs();
        FileOutputStream outputStream = new FileOutputStream(outputFile);
        try {/*from   ww  w.ja  v a2 s  . co  m*/
            outputStream.write(bytes);
        } finally {
            outputStream.close();
        }
    }
}

Related

  1. writeBytes(File file, byte[] bytes, boolean append)
  2. writeBytes(File file, byte[] data)
  3. writeBytes(File file, byte[] pattern, int repeat)
  4. writeBytes(File file, byte[] source, int offset, int len)
  5. writeBytes(File filename, byte[] contents)
  6. writeBytes(final File file, final byte[] bytes)
  7. writeBytes(final File file, final byte[] bytes)
  8. writeBytes(int[] data, String filename)
  9. writeBytes(int[] data, String filename)