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

Parameter

Parameter Description
file a parameter
content a parameter

Exception

Parameter Description
IOException an exception

Declaration

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

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2010-2012 by Min Cai (min.cai.china@gmail.com).
 *
 * This file is part of the PickaPack library.
 *
 * PickaPack is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.//from   w  w  w.  j a  va 2 s  . c  o  m
 *
 * PickaPack is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with PickaPack. If not, see <http://www.gnu.org/licenses/>.
 ******************************************************************************/

import java.io.*;

public class Main {
    /**
     *
     * @param file
     * @param content
     * @throws IOException
     */
    public static void save(File file, byte[] content) throws IOException {
        FileOutputStream out = new FileOutputStream(file);
        save(out, content);
        out.close();
    }

    /**
     *
     * @param out
     * @param content
     * @throws IOException
     */
    public static void save(OutputStream out, byte[] content) throws IOException {
        out.write(content);
    }
}

Related

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