Here you can find the source of writeFileRaw(String fileName, byte[][] contents)
Parameter | Description |
---|---|
fileName | name of the file (or path relative to directory) |
contents | an arrays of bytes and corresponding charsets. |
public static void writeFileRaw(String fileName, byte[][] contents) throws IOException
//package com.java2s; /**//from w w w . j av a 2s . c o m * Copyright (C) 2016 Netflix, Inc. * * This file is part of IMF Conversion Utility. * * IMF Conversion Utility 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. * * IMF Conversion Utility 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 IMF Conversion Utility. If not, see <http://www.gnu.org/licenses/>. */ import java.io.BufferedOutputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; public class Main { /** * Method to write raw content to the file. * * @param fileName name of the file (or path relative to directory) * @param contents an arrays of bytes and corresponding charsets. */ public static void writeFileRaw(String fileName, byte[][] contents) throws IOException { try (OutputStream output = new BufferedOutputStream(new FileOutputStream(fileName))) { for (byte[] content : contents) { output.write(content); } output.flush(); } } }