Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

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);
}
Comment

decode base64 to file java

// Note preferred way of declaring an array variable
byte[] data = Base64.decodeBase64(crntImage);
try (OutputStream stream = new FileOutputStream("c:/decode/abc.bmp")) {
    stream.write(data);
}
Comment

java base64 to file

byte[] data = Base64.decodeBase64(base64Img);
try (OutputStream stream = new FileOutputStream("c:/xxxx/xxxx.xx")) {
    stream.write(data);
}
Comment

PREVIOUS NEXT
Code Example
Java :: min of an array java 
Java :: java csv 
Java :: setint java 
Java :: junit 5 expected exception 
Java :: check array is sorted java 
Java :: java read first line of file 
Java :: loop through a 2d array java 
Java :: getconstructor java 
Java :: java split for multiple characters 
Java :: java outer class 
Java :: bukkit Command sender is player 
Java :: minecraft chunk size 
Java :: java while schleife 
Java :: how to scan a string in java 
Java :: capitalize each word in string java 
Java :: java get classname 
Java :: print star pattern in java 
Java :: copy arraylist java 
Java :: print the list in java 
Java :: how to change image resolution in android programmatically 
Java :: java linkedlist print 
Java :: how to get width android 
Java :: java convert string to int array 
Java :: java foreach arraylist 
Java :: How to use Runnable interface to develop multi-threaded Java programs? 
Java :: get request java 
Java :: java iso 8601 format 
Java :: regex pattern for date validation 
Java :: error cannot find symbol intent 
Java :: convert int to ascii java 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =