public byte[] readFile(File file) throws IOException {
byte[] data = new byte[(int)file.length()];
BufferedInputStream buffy = new BufferedInputStream(new FileInputStream(file));
buffy.read(data);
return data;
}
public byte[] readFile(File file) throws IOException {
FileChannel fc = new FileInputStream(file).getChannel();
ByteBuffer buff = ByteBuffer.allocate((int)file.length());
fc.read(buff);
return buff.array();
}