Template:Convert file to base64-encoding using Java

From Updox API
Jump to: navigation, search
 File file = new File("c:\filename.ext");
 
 byte[] bytes = loadFile(file);
 
 byte[] encoded = Base64.encodeBase64(bytes);
 
 String encodedString = new String(encoded);