Here you can find the source of writeBytes(String filename, byte[] data, int len)
public static void writeBytes(String filename, byte[] data, int len) throws FileNotFoundException, IOException
//package com.java2s; /*/* w w w. j av a2 s . c o m*/ * BioJava development code * * This code may be freely distributed and modified under the * terms of the GNU Lesser General Public Licence. This should * be distributed with the code. If you do not have a copy, * see: * * http://www.gnu.org/copyleft/lesser.html * * Copyright for this code is held jointly by the individual * authors. These should be listed in @author doc comments. * * For more information on the BioJava project and its aims, * or to join the biojava-l mailing list, visit the home page * at: * * http://www.biojava.org/ * * Created on Nov 4, 2016 * Author: blivens * */ import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; public class Main { public static void writeBytes(String filename, byte[] data) throws FileNotFoundException, IOException { writeBytes(filename, data, data.length); } public static void writeBytes(String filename, byte[] data, int len) throws FileNotFoundException, IOException { if (filename == null || filename.isEmpty()) { return; } try (FileOutputStream out = new FileOutputStream(filename)) { out.write(data, 0, len); } } }