Java FileOutputStream Write save(File file, byte[] content)

Here you can find the source of save(File file, byte[] content)

Description

save

License

Open Source License

Declaration

public static void save(File file, byte[] content) throws IOException 

Method Source Code

//package com.java2s;

import java.io.File;

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

public class Main {
    public static void save(File file, byte[] content) throws IOException {
        FileOutputStream out = new FileOutputStream(file);
        try {/*  ww w .  j  av  a2s  .  c o m*/
            out.write(content);
        } finally {
            out.close();
        }
    }

    public static void save(String fileName, byte[] content) throws IOException {
        FileOutputStream out = new FileOutputStream(fileName);
        try {
            out.write(content);
        } finally {
            out.close();
        }
    }
}

Related

  1. copyFileUsingStream(InputStream sourceStream, File dest)
  2. save(byte[] bs, String fn)
  3. save(byte[] bytes, File path)
  4. save(byte[] data, String path)
  5. save(File file, byte[] bytes)
  6. save(File file, byte[] content)
  7. save(File file, final byte[] encoded)
  8. save(final InputStream in, final File file)
  9. save(InputStream in, File f)