Here you can find the source of getBytesFromFile(File file)
public static byte[] getBytesFromFile(File file) throws IOException
//package com.java2s; /**//w w w . j a v a 2 s. c o m * License: https://github.com/votingsystem/votingsystem/wiki/Licencia */ import java.io.*; public class Main { public static byte[] getBytesFromFile(File file) throws IOException { byte[] b = new byte[(int) file.length()]; FileInputStream fs = new FileInputStream(file); fs.read(b); fs.close(); return b; } }