Java FileOutputStream Create writeFileData(File file, byte[] fileData)

Here you can find the source of writeFileData(File file, byte[] fileData)

Description

Writes the specified data to the specified fie

License

Open Source License

Parameter

Parameter Description
file Description of the Parameter
fileData Description of the Parameter

Exception

Parameter Description

Declaration

public static void writeFileData(File file, byte[] fileData)
        throws IOException 

Method Source Code

//package com.java2s;
/*//from   w  w  w . j  av a2 s. c  om
 * Copyright (c) Fiorano Software and affiliates. All rights reserved. http://www.fiorano.com
 * The software in this package is published under the terms of the CPAL v1.0
 * license, a copy of which has been included with this distribution in the
 * LICENSE.txt file.
 */

import java.io.*;

public class Main {
    /**
     * Writes the specified data to the specified fie
     *
     * @param file     Description of the Parameter
     * @param fileData Description of the Parameter
     * @throws java.io.IOException           Description of the Exception
     * @throws java.io.FileNotFoundException Description of the Exception
     */
    public static void writeFileData(File file, byte[] fileData)
            throws IOException {
        BufferedOutputStream bos = new BufferedOutputStream(
                new FileOutputStream(file));
        bos.write(fileData);
        bos.close();
    }
}

Related

  1. writeFileBytes(File pFile, byte[] pBytes)
  2. writeFileContent(String filepath, byte[] content)
  3. writeFileContent(String sFileName, byte[] content)
  4. writeFileCover(String path, String content)
  5. writeFileData(File dataFile, String targetFile)
  6. writeFileFromBytes(byte[] bytes, File file)
  7. writeFileFromStream(File tempFile, InputStream in)
  8. writeFileFromString(File outputFileName, String content)
  9. writeFileRaw(String fileName, byte[][] contents)