Hi, I have a series of 20 byte values that I'd like to store with some other metatdata in an XML file... Is this possible without converting the byte to a string representation? If I had to convert the bytes to string how can I retrieve the original value? Thanks very much Gareth
There are plenty of byte values that are not valid as XML characters and would cause a parse error - you must convert to a String representation. You can encode as Hexadecimal where each byte becomes 2 characters or using base64 where 3 bytes become 4 characters and = characters fill out the end if the array size is not evenly divisible by 3. The Jakarta Apache Commons project - CODEC toolkit has some converters to and from byte. Bill
Joined: Apr 07, 2004
Ah great! The Commons project is brilliant! I should have looked there first. Thanks for pointing that out! Happy Easter to everyone!