List of utility methods to do Base64 Encode
String | base64Encode(final byte[] data) base Encode String res = null; try { res = new String(Base64.encodeBase64(data)); } catch (Exception e) { e.printStackTrace(); return res; |
String | encode(byte[] src) encode return Base64.encodeToString(src, Base64.DEFAULT);
|
String | to64(String a) to return Base64.encodeToString(a.getBytes(), Base64.DEFAULT);
|
String | toBase64(byte[] barray) to Base if (barray == null) { return ""; String result; result = Base64.encodeToString(barray, MAGNET_BASE64_FLAGS); return result; |
String | encodeBase64(byte abyte0[]) encode Base if (abyte0 == null) return ""; char ac[] = new char[4 * ((2 + abyte0.length) / 3)]; int i = 0; for (int j = 0; j < -2 + abyte0.length; j += 3) { int k2 = ((0xff & abyte0[j]) << 16) + ((0xff & abyte0[j + 1]) << 8) + (0xff & abyte0[j + 2]); ... |
String | encodeBase64(String input) Encodes a string with Base64 byte[] data = input.getBytes("UTF-8"); return Base64.encodeToString(data, Base64.DEFAULT); |
String | encryptToBase64Text(String key, String src) encrypt To Base Text byte[] result = encryptToBytes(key, src); return new String(Base64.encode(result, Base64.DEFAULT)); |
String | generateBase64String(String inString) generate Base String byte[] byteTransform = inString.getBytes("UTF-8"); return Base64.encodeToString(byteTransform, Base64.NO_WRAP); |
byte[] | ImageBase64Decode(String base64_str) Image Base64 Decode byte[] b = Base64.decode(base64_str, Base64.DEFAULT); for (int i = 0; i < b.length; i++) { if (b[i] < 0) { b[i] += 256; return b; |
String | longKeyId2Base64String(long keyId) long Key Id Base String try { return new String(Base64.encode( ByteBuffer.allocate(Long.SIZE / 8).putLong(keyId) .array(), Base64.NO_WRAP), "UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); return null; |