Here you can find the source of readFileEx(String... file)
public static byte[] readFileEx(String... file) throws IOException
//package com.java2s; /*/*from w w w.j a va 2 s.c o m*/ * Copyright (C) 2010-2016 JPEXS, All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3.0 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. */ import java.io.ByteArrayOutputStream; import java.io.FileInputStream; import java.io.IOException; public class Main { public static byte[] readFileEx(String... file) throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); for (String f : file) { FileInputStream fis = null; try { fis = new FileInputStream(f); byte[] buf = new byte[4096]; int cnt; while ((cnt = fis.read(buf)) > 0) { baos.write(buf, 0, cnt); } } finally { if (fis != null) { try { fis.close(); } catch (IOException ex) { //ignore } } } } return baos.toByteArray(); } }