public static byte[] decode(String data) throws CoderException {
  byte[] array=new byte[data.length() * 3 / 4];
  char[] block=new char[4];
  int length=0;
  data=data.trim();
  final int len=data.length();
  if (len == 0)   return new byte[0];
  if (len % 4 != 0 || len < 4)   throw new CoderException("can't decode the the base64 input string" + printString(data) + ", because the input string has an invalid length");
  for (int position=0; position < len; ) {
    int p;
    for (p=0; p < 4 && position < data.length(); position++) {
      char c=data.charAt(position);
      if (!Character.isWhitespace(c)) {
        block[p]=c;
        p++;
      }
    }
    if (p == 0)     break;
    int l=decodeGroup(block,array,length);
    length+=l;
    if (l < 3)     break;
  }
  return Arrays.copyOf(array,length);
}

public static byte [ ] decode ( String data ) throws CoderException { byte [ ] array = new byte [ data . length ( ) * 3 / 4 ] ; char [ ] block = new char [ 4 ] ; int length = 0 ; data = data . trim ( ) ; final int len = data . length ( ) ; if ( len == 0 ) return new byte [ 0 ] ; if ( len % 4 != 0 || len < 4 ) throw new CoderException ( "can't decode the the base64 input string" + printString ( data ) + ", because the input string has an invalid length" ) ; for ( int position = 0 ; position < len ; ) { int p ; for ( p = 0 ; p < 4 && position < data . length ( ) ; position ++ ) { char c = data . charAt ( position ) ; if ( ! Character . isWhitespace ( c ) ) { block [ p ] = c ; p ++ ; } } if ( p == 0 ) break ; int l = decodeGroup ( block , array , length ) ; length += l ; if ( l < 3 ) break ; } return Arrays . copyOf ( array , length ) ; }
translates the specified base64 string into a byte array .
