Compare commits
No commits in common. "master" and "06edfbd3b0" have entirely different histories.
master
...
06edfbd3b0
@ -34,11 +34,6 @@ import java.util.Base64;
|
||||
|
||||
public class File64 {
|
||||
|
||||
/*
|
||||
This function transforms a binary file to byte[] array.
|
||||
This allows it to be turned into a base64 encoded string suitable for use in
|
||||
JSON.
|
||||
*/
|
||||
private static byte[] file_to_byte(File input_file) throws FileNotFoundException, IOException {
|
||||
byte[] file_bytes;
|
||||
try (InputStream file_stream = new FileInputStream(input_file)) {
|
||||
@ -61,7 +56,7 @@ public class File64 {
|
||||
}
|
||||
|
||||
/**
|
||||
* The default interface. Files or strings are ingested and returned from here.
|
||||
*
|
||||
* @param to_encode
|
||||
* @param is_path
|
||||
* @return
|
||||
@ -78,6 +73,8 @@ public class File64 {
|
||||
} else if (!is_path) {
|
||||
encoded_string = Base64.getEncoder().encodeToString(to_encode.getBytes());
|
||||
}
|
||||
// byte[] decoded_bytes = Base64.getDecoder().decode(encoded_string);
|
||||
// String decoded_string = new String(decoded_bytes);
|
||||
return encoded_string;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user