Base64 encode data: Difference between revisions

Line 1,192:
</syntaxhighlight>
<syntaxhighlight lang="java">
Stringbyte[] encodeFile(String path) throws IOException {
try (FileInputStream stream = new FileInputStream(path)) {
byte[] bytes = stream.readAllBytes();
return Base64.getEncoder().encodeToStringencode(bytes);
}
}
118

edits