diff --git a/src/File64/File64.java b/src/File64/File64.java index 9706a2f..83a3ef3 100644 --- a/src/File64/File64.java +++ b/src/File64/File64.java @@ -34,6 +34,11 @@ 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)) { @@ -56,7 +61,7 @@ public class File64 { } /** - * + * The default interface. Files or strings are ingested and returned from here. * @param to_encode * @param is_path * @return @@ -73,8 +78,6 @@ 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; } }