List of utility methods to do Base64 Encode
String | base64Encoder(byte[] src, int start, int wrapAt) base Encoder return base64Encoder(src, start, src.length, wrapAt);
|
String | base64Encoder(String str) base Encoder byte[] b = null; String s = null; try { b = str.getBytes("utf-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); if (b != null) { ... |
String | base64encoding(byte[] bytes) baseencoding Encoder encoder = Base64.getEncoder();
return encoder.encodeToString(bytes);
|
byte[] | base64UrlDecode(final String encodedString) base Url Decode return base64UrlDecode(encodedString.getBytes());
|
String | base64UrlEncode(final byte[] v) base Url Encode return BASE64_ENC.encodeToString(v).replaceAll("=*$", ""); |
int | encodeBASE64(InputStream in, OutputStream out) This implements a BASE64 character decoder as specified in RFC1521. int len; int count = 0; byte[] chunk = new byte[3]; while ((len = in.read(chunk)) > 0) { byte a, b, c; count += len; if (len == 1) { a = chunk[0]; ... |
int | encodeBase64(InputStream is, OutputStream os) encode Base int written = 0; int avail; byte[] buffer = { '=', '=', '=', '=' }; int i; int value = 0; while ((avail = is.available()) > 0) { if (avail > 3) avail = 3; ... |
String | encodeBase64(String data) Encodes a String as a base64 String. byte[] bytes = null; try { bytes = data.getBytes("UTF-8"); } catch (UnsupportedEncodingException uee) { uee.printStackTrace(); return encodeBase64(bytes); |
String | encodeBase64(String data) Encodes a String as a base64 String. return encodeBase64(data.getBytes("GBK")); |
String | toBase64(byte[] array) to Base return Base64.getEncoder().encodeToString(array);
|