package framework.util; import java.io.File; import java.io.FileInputStream; public class FileUtil { public static byte[] getFileContent(File file) throws Throwable { FileInputStream fis = null; byte[] b = new byte[0]; try{ fis = new FileInputStream(file); int fsize = fis.available(); b = new byte[fsize]; fis.read(b); }catch(Exception e){ throw e; }finally{ try{ fis.close(); }catch(Exception e){ } } return b; } }