public static byte[] hexToArray(final String data) throws ConversionException {
  try {
    return Hex.decodeHex(data.toCharArray());
  }
 catch (  DecoderException e) {
    throw new ConversionException("Cannot convert given hex text into plain text",e);
  }
}

public static byte [ ] hexToArray ( final String data ) throws ConversionException { try { return Hex . decodeHex ( data . toCharArray ( ) ) ; } catch ( DecoderException e ) { throw new ConversionException ( "Cannot convert given hex text into plain text" , e ) ; } }
converts the given hex string into a plain string .
