Android Utililty Methods Base64 Byte Array Encode

List of utility methods to do Base64 Byte Array Encode

Description

The list of methods to do Base64 Byte Array Encode are organized into topic(s).

Method

Stringencode(byte[] data)
encode
int start = 0;
int len = data.length;
StringBuffer buf = new StringBuffer(data.length * 3 / 2);
int end = len - 3;
int i = start;
int n = 0;
while (i <= end) {
    int d = ((((int) data[i]) & 0x0ff) << 16)
...
byte[]encode(byte[] data)
encode
byte[] bytes;
int modulus = data.length % 3;
if (modulus == 0) {
    bytes = new byte[(4 * data.length) / 3];
} else {
    bytes = new byte[4 * ((data.length / 3) + 1)];
int dataLength = (data.length - modulus);
...
Stringencode(byte raw[])
encode
StringBuffer encoded = new StringBuffer();
for (int i = 0; i < raw.length; i += 3) {
    encoded.append(encodeBlock(raw, i));
return encoded.toString();
Stringencode(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]);
...
Stringencode(byte[] bytes)
encode
return new String(Base64.encode(bytes, Base64.DEFAULT));
byte[]encode(byte[] data)
encode
byte[] bytes;
int modulus = data.length % 3;
if (modulus == 0) {
    bytes = new byte[(4 * data.length) / 3];
} else {
    bytes = new byte[4 * ((data.length / 3) + 1)];
int dataLength = (data.length - modulus);
...
Stringencode(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]);
...
Stringencode(byte[] data)
Outputs base64 representation of the specified stream data to a String.
StringWriter writer = new StringWriter();
try {
    encode(data, 0, data.length, writer);
} catch (IOException ioe) {
    throw new IllegalStateException(ioe);
return writer.toString();
voidencode(byte[] data, int off, int len, Writer writer)
Outputs base64 representation of the specified data to a Writer.
if (len == 0) {
    return;
if (len < 0 || off >= data.length || len + off > data.length) {
    throw new IllegalArgumentException();
char[] enc = new char[4];
while (len >= 3) {
...
Stringencode(byte[] data)
encode
StringBuffer buffer = new StringBuffer();
int length = data.length;
int indexx = 0;
int b1, b2, b3;
while (indexx < length) {
    b1 = data[indexx++] & 0xff;
    if (indexx == length) {
        buffer.append(ENCODE_CHARS[b1 >>> 2]);
...