Ascii85 Codec provides an InputStream and an OutputStream that read and write Ascii85, also known as Base85. It is more compact than Base64 and drops into any Java I/O pipeline as a standard filter stream.
Try it
Ascii85
<~87cURD_*#TDfTZ)+T~>
Input13 bytes
Ascii8517 chars +31%
Base6420 chars +54%
Counting encoded characters only, without the <~ ~> markers or line breaks.
Runs a JavaScript port of the library and was tested against it to give the same results, errors included.
Encode a file
try (InputStream in = new FileInputStream("image.png");
OutputStream out = new Ascii85OutputStream(
new FileOutputStream("image.a85"))) {
in.transferTo(out);
}