public static byte[] decode(String str) throws CoderException {
  byte out[]=new byte[str.length()];
  int len=0;
  int offset=0;
  byte b=0;
  boolean stop=false;
  StringCharacterIterator it=new StringCharacterIterator(str);
  do {
    b=_dec(it.current());
    it.next();
    if (b > 45)     throw new CoderException("can't decode string [" + str + "]");
    if (b < 45)     stop=true;
    len+=b;
    for (; b > 0; b-=3) {
      decodeChars(it,out,offset);
      offset+=3;
    }
    it.next();
  }
 while (!stop);
  byte rtn[]=new byte[len];
  for (int i=0; i < len; i++)   rtn[i]=out[i];
  return rtn;
}

public static byte [ ] decode ( String str ) throws CoderException { byte out [ ] = new byte [ str . length ( ) ] ; int len = 0 ; int offset = 0 ; byte b = 0 ; boolean stop = false ; StringCharacterIterator it = new StringCharacterIterator ( str ) ; do { b = _dec ( it . current ( ) ) ; it . next ( ) ; if ( b > 45 ) throw new CoderException ( "can't decode string [" + str + "]" ) ; if ( b < 45 ) stop = true ; len += b ; for ( ; b > 0 ; b -= 3 ) { decodeChars ( it , out , offset ) ; offset += 3 ; } it . next ( ) ; } while ( ! stop ) ; byte rtn [ ] = new byte [ len ] ; for ( int i = 0 ; i < len ; i ++ ) rtn [ i ] = out [ i ] ; return rtn ; }
decodes back a string to a byte array
