Android Byte Array Save to File writeFile(String fileName, byte[] content)

Here you can find the source of writeFile(String fileName, byte[] content)

Description

write File

Declaration

public static void writeFile(String fileName, byte[] content) 

Method Source Code

//package com.java2s;

import java.io.FileOutputStream;

public class Main {

    public static void writeFile(String fileName, byte[] content) {

        try {/*from www  . ja v a 2s . c om*/
            FileOutputStream fos = new FileOutputStream(fileName);
            fos.write(content);
            fos.flush();
            fos.close();
        } catch (Exception e) {
        }
    }

    public static void writeFile(String fileName, String content) {

        writeFile(fileName, content.getBytes());
    }
}

Related

  1. copy(byte[] input, Writer output, String encoding)
  2. saveBytes(@NotNull File file, @NotNull byte[] bytes)
  3. saveFile(byte[] data, String fileName)
  4. writeBytes(File file, boolean append, byte[] bytes)
  5. writeBytes(byte[] bytes, File file, boolean append)
  6. writeFile(String fileName, byte[] datas, boolean overwrite)
  7. writeFile(String path, String fileName, byte[] datas, boolean overwrite)
  8. saveBytes(byte[] bytes, File file)
  9. saveBytes(byte[] bytes, OutputStream out)