code: public static byte[] decode(char[] src, int[] table, char pad) {
          int len = src.length;
  
          if (len == 0) return new byte[0];
  
          int padCount = (src[len - 1] == pad ? (src[len - 2] == pad ? 2 : 1) : 0);
          int bytes    = (len * 6 >> 3) - padCount;
          int blocks   = (bytes / 3) * 3;
  
          byte[] dst = new byte[bytes];
          int si = 0, di = 0;
  
          while (di < blocks) {
              int n = table[src[si++]] << 18 | table[src[si++]] << 12 | table[src[si++]] << 6 | table[src[si++]];
              dst[di++] = (byte) (n >> 16);
              dst[di++] = (byte) (n >>  8);
              dst[di++] = (byte) n;
          }
  
          if (di < bytes) {
              int n = 0;
              switch (len - si) {
                  case 4: n |= table[src[si+3]];
                  case 3: n |= table[src[si+2]] <<  6;
                  case 2: n |= table[src[si+1]] << 12;
                  case 1: n |= table[src[si]]   << 18;
              }
              for (int r = 16; di < bytes; r -= 8) {
                  dst[di++] = (byte) (n >> r);
              }
          }
  
          return dst;
      }
docs: Decode base64 chars to bytes using the supplied decode table and padding
  character.
  
  @param src   Base64 encoded data.
  @param table Decode table.
  @param pad   Padding character.
  
  @return Decoded bytes.