List of utility methods to do Base64 Byte Array Encode
String | encode(byte[] bytes) encode return new String(Base64.encode(bytes, Base64.DEFAULT)); |
String | encode(byte[] data) encode StringBuffer sb = new StringBuffer(); int len = data.length; int i = 0; int b1, b2, b3; while (i < len) { b1 = data[i++] & 0xff; if (i == len) { sb.append(base64EncodeChars[b1 >>> 2]); ... |
String | encode(byte[] arr) Converts byte array to String return Base64.encodeToString(arr, Base64.DEFAULT);
|
String | encode(byte[] data) encode StringBuffer sb = new StringBuffer(); int len = data.length; int i = 0; int b1, b2, b3; while (i < len) { b1 = data[i++] & 0xff; if (i == len) { sb.append(base64EncodeChars[b1 >>> 2]); ... |
String | encodeWebSafe(byte[] source, boolean doPadding) Encodes a byte array into web safe Base64 notation. return encode(source, 0, source.length, WEBSAFE_ALPHABET, doPadding);
|
String | encode(byte[] bytes) encode if (bytes == null) { return null; if (bytes.length == 0) { return ""; int groupCount = bytes.length / 3; StringBuffer resultBuffer = new StringBuffer(); ... |
String | encode(byte[] data) encode StringBuffer sb = new StringBuffer(); int len = data.length; int i = 0; int b1, b2, b3; while (i < len) { b1 = data[i++] & 0xff; if (i == len) { sb.append(base64EncodeChars[b1 >>> 2]); ... |
char | encodeBase64Byte(byte base64Byte) encode Base Byte if ((base64Byte >= 0) && (base64Byte <= 25)) { return (char) (base64Byte + 65); } else if ((base64Byte >= 26) && (base64Byte <= 51)) { return (char) (base64Byte - 26 + 97); } else if ((base64Byte >= 52) && (base64Byte <= 61)) { return (char) (base64Byte - 52 + 48); } else if (base64Byte == 62) { return '+'; ... |
String | encodeLast2Bytes(byte bytes[]) encode Last Bytes byte firstByte = bytes[bytes.length - 2]; byte secondByte = bytes[bytes.length - 1]; StringBuffer resultBuffer = new StringBuffer(); byte bufferByte = 0; bufferByte = (byte) (firstByte >> 2); resultBuffer.append(encodeBase64Byte(bufferByte)); bufferByte = (byte) (((firstByte & 0x03) << 4) | (secondByte >> 4)); resultBuffer.append(encodeBase64Byte(bufferByte)); ... |
String | encodeLast1Byte(byte bytes[]) encode Last Byte byte lastByte = bytes[bytes.length - 1]; StringBuffer resultBuffer = new StringBuffer(); byte bufferByte = 0; bufferByte = (byte) (lastByte >> 2); resultBuffer.append(encodeBase64Byte(bufferByte)); bufferByte = (byte) ((lastByte & 0x03) << 4); resultBuffer.append(encodeBase64Byte(bufferByte)); resultBuffer.append('='); ... |