List of utility methods to do Base64 InputStream Encode
void | encode(InputStream in, Writer writer) Outputs base64 representation of the specified stream data to a Writer .
byte[] buffer = new byte[9 * 1024]; int read; while ((read = in.read(buffer)) > 0) { encode(buffer, 0, read, writer); |
void | encode(InputStream in, OutputStream out) Outputs base64 representation of the specified stream data to an OutputStream .
Writer writer = new OutputStreamWriter(out, CHARSET);
encode(in, writer);
|
void | streamToBase64(InputStream in, StringBuilder sb) stream To Base int buflen = 4096; byte[] buffer = new byte[buflen]; int offset = 0; int len = 0; while (len != -1) { len = in.read(buffer, offset, buffer.length - offset); if (len != -1) { int total = offset + len; ... |