public static byte[] decode(String hexa) throws CoderException {
  if (hexa == null) {
    throw new CoderException("can't decode empty String");
  }
  if ((hexa.length() % 2) != 0) {
    throw new CoderException("invalid hexadicimal String");
  }
  int tamArray=hexa.length() / 2;
  byte[] retorno=new byte[tamArray];
  for (int i=0; i < tamArray; i++) {
    retorno[i]=hexToByte(hexa.substring(i * 2,i * 2 + 2));
  }
  return retorno;
}

public static byte [ ] decode ( String hexa ) throws CoderException { if ( hexa == null ) { throw new CoderException ( "can't decode empty String" ) ; } if ( ( hexa . length ( ) % 2 ) != 0 ) { throw new CoderException ( "invalid hexadicimal String" ) ; } int tamArray = hexa . length ( ) / 2 ; byte [ ] retorno = new byte [ tamArray ] ; for ( int i = 0 ; i < tamArray ; i ++ ) { retorno [ i ] = hexToByte ( hexa . substring ( i * 2 , i * 2 + 2 ) ) ; } return retorno ; }
decodes back a string to a byte array
