Here you can find the source of writeToBinaryFile(String filePath, byte[] binaryContent)
private static void writeToBinaryFile(String filePath, byte[] binaryContent) throws IOException
//package com.java2s; /*/* w ww.j av a2s. c o m*/ Copyright (C) 2014 NTT DATA Corporation This program 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, version 2. This program 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. */ import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; public class Main { private static void writeToBinaryFile(String filePath, byte[] binaryContent) throws IOException { Path path = Paths.get(filePath); Files.write(path, binaryContent); } }