Android Base64 Byte Array Encode encodeBase64Byte(byte base64Byte)

Here you can find the source of encodeBase64Byte(byte base64Byte)

Description

encode Base Byte

Declaration

private static char encodeBase64Byte(byte base64Byte) 

Method Source Code

//package com.java2s;

public class Main {
    private static char encodeBase64Byte(byte base64Byte) {
        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 '+';
        } else if (base64Byte == 63) {
            return '/';
        } else {//from ww  w.  j a v  a  2 s. c  o  m
            return '0';
        }
    }
}

Related

  1. encode(byte[] arr)
  2. encode(byte[] data)
  3. encodeWebSafe(byte[] source, boolean doPadding)
  4. encode(byte[] bytes)
  5. encode(byte[] data)
  6. encodeLast2Bytes(byte bytes[])
  7. encodeLast1Byte(byte bytes[])
  8. encode(byte[] data)
  9. encode(byte[] data)