Here you can find the source of save(File file, byte[] content)
Parameter | Description |
---|---|
file | a parameter |
content | a parameter |
Parameter | Description |
---|---|
IOException | an exception |
public static void save(File file, byte[] content) throws IOException
//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); } }