Answers for "encode file to base64 java"

0

encode file to base64 java

private static String encodeFileToBase64Binary(String fileName) throws IOException {
    File file = new File(fileName);
    byte[] encoded = Base64.encodeBase64(FileUtils.readFileToByteArray(file));
    return new String(encoded, StandardCharsets.US_ASCII);
}
Posted by: Guest on May-10-2022

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language