src/org/kocakosm/pitaya/util/BaseEncoding.java
public byte[] decode(String in)
	{
		String encoded = n > 0 ? in.replace(separator, "") : in;
		ByteBuffer buf = new ByteBuffer(maxDecodedLength(encoded.length()));
		int accu = 0;
		int count = 0;
		int decoded = 0;
		for (int i = 0; i < encoded.length(); i++) {
			char c = encoded.charAt(i);
			if (isPaddingChar(c) && !omitPadding) {
				break;
			}
			int v = decode(c);
			if (v != -1) {
				decoded++;
				accu = (accu << alphabet.bitsPerChar()) | v;
				count += alphabet.bitsPerChar();
				while (count >= 8) {
					count -= 8;
					buf.append((byte) (accu >>> count));
				}
			}
		}
		if (!omitPadding || !alphabet.requiresPadding()) {
			decoded += getPaddingLength(encoded);
			int blockSize = alphabet.charsPerBlock();
			Parameters.checkCondition(decoded % blockSize == 0);
		}
		return buf.toByteArray();
	}
public byte[] decode(String in)
	{
		String encoded = n > 0 ? in.replace(separator, "") : in;
		ByteBuffer buf = new ByteBuffer(maxDecodedLength(encoded.length()));
		int accu = 0;
		int count = 0;
		int decoded = 0;
		for (int i = 0; i < encoded.length(); i++) {
			char c = encoded.charAt(i);
			if (isPaddingChar(c) && !omitPadding) {
				break;
			}
			int v = decode(c);
			if (v != -1) {
				decoded++;
				accu = (accu << alphabet.bitsPerChar()) | v;
				count += alphabet.bitsPerChar();
				while (count >= 8) {
					count -= 8;
					buf.append((byte) (accu >>> count));
				}
			}
		}
		if (!omitPadding || !alphabet.requiresPadding()) {
			decoded += getPaddingLength(encoded);
			int blockSize = alphabet.charsPerBlock();
			Parameters.checkCondition(decoded % blockSize == 0);
		}
		return buf.toByteArray();
	}
public byte [ ] decode ( String in ) { String encoded = n > 0 ? in . replace ( separator , "" ) : in ; ByteBuffer buf = new ByteBuffer ( maxDecodedLength ( encoded . length ( ) ) ) ; int accu = 0 ; int count = 0 ; int decoded = 0 ; for ( int i = 0 ; i < encoded . length ( ) ; i ++ ) { char c = encoded . charAt ( i ) ; if ( isPaddingChar ( c ) && ! omitPadding ) { break ; } int v = decode ( c ) ; if ( v != - 1 ) { decoded ++ ; accu = ( accu << alphabet . bitsPerChar ( ) ) | v ; count += alphabet . bitsPerChar ( ) ; while ( count >= 8 ) { count -= 8 ; buf . append ( ( byte ) ( accu >>> count ) ) ; } } } if ( ! omitPadding || ! alphabet . requiresPadding ( ) ) { decoded += getPaddingLength ( encoded ) ; int blockSize = alphabet . charsPerBlock ( ) ; Parameters . checkCondition ( decoded % blockSize == 0 ) ; } return buf . toByteArray ( ) ; }
Decodes the given encoded {@code String} according to this
{@code BaseEncoding}'s configuration. Decoding is not case-sensitive
when possible (namely for Base16, Base32 and Base32Hex schemes).

@param in the input {@code String}.

@return the decoded data.

@throws NullPointerException if {@code in} is {@code null}.
@throws IllegalArgumentException if {@code in} is not a valid
base-encoded {@code String} according to this
{@code BaseEncoding}'s configuration.
Decodes the given encoded { @code String } according to this { @code BaseEncoding } s configuration . Decoding is not case - sensitive when possible ( namely for Base16 Base32 and Base32Hex schemes ) .