Here you can find the source of decodeBase64(File file)
public static String decodeBase64(File file)
//package com.java2s; //License from project: Open Source License import javax.xml.bind.DatatypeConverter; import java.io.*; public class Main { public static String decodeBase64(File file) { FileInputStream fis = null; try {//from ww w. jav a 2s .c o m fis = new FileInputStream(file); byte[] imageBytes = new byte[(int) file.length()]; fis.read(imageBytes); fis.close(); return DatatypeConverter.printBase64Binary(imageBytes); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return null; } }