Java Base64 base64toInt(char c, byte[] alphaToInt)

Here you can find the source of base64toInt(char c, byte[] alphaToInt)

Description

Translates the specified character, which is assumed to be in the "Base 64 Alphabet" into its equivalent 6-bit positive integer.

License

Open Source License

Declaration

private static int base64toInt(char c, byte[] alphaToInt) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//  ww  w .  j  av a 2 s .  c om
     * Translates the specified character, which is assumed to be in the "Base 64 Alphabet" into its equivalent 6-bit
     * positive integer.
     * 
     * @throw IllegalArgumentException or ArrayOutOfBoundsException if c is not in the Base64 Alphabet.
     */
    private static int base64toInt(char c, byte[] alphaToInt) {
        int result = alphaToInt[c];
        if (result < 0) {
            throw new IllegalArgumentException("Illegal character " + c);
        }
        return result;
    }
}

Related

  1. base64ReadChunk(InputStream in, byte[] chunk)
  2. base64ToBits(char data)
  3. base64ToByteArray(String s)
  4. base64ToBytes(final String base64)
  5. base64ToBytes(String value)
  6. base64UrlFriendly(String base)
  7. base64Value(char digit)