Raj Smile wrote:Rob, can you please give me a code snippet for this.
Well, assuming I'm now following this, and that
3C524F4F54...
stream is actually a sequence of bytes containing the
ASCII (or UTF-8) characters '3', 'C', '5' and so on, there is more than one way to do it, but you'll still need a
Reader to translate those "byte" characters to Java ones first.
Once you actually have the Java characters as a String (or Strings), you can then use either:
Byte.parseByte(String, radix) to convert them on an individual basis,
or possibly:
BigInteger(String, radix) to create a BigInteger from the whole thing,
and then:
BigInteger.toByteArray() to convert it to a byte array.
But you'll then need
another Reader to convert the resulting bytes back to Java characters again.
HIH
Winston