dcsimg
convert to HEX
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Jyri_Saastamoinen
Posted On:   Tuesday, May 18, 2004 07:00 AM

What I need to do if I want to convert some file ie. text file to .hex file? Do I need to read that file to byteArray and then convert each byte to hex string with method toHexString(int i). Can anyone give me an example how to do such a conversion?

Tia JJ

Re: convert to HEX

Posted By:   Sean_Owen  
Posted On:   Tuesday, May 18, 2004 07:10 AM

Yes, if your requirement is to read a file's bytes and write them out again as hexadecimal numbers, then yes that is the way to do it. Read chunks of the file into a byte array, then write the hex value of each one to a new file, and repeat.
About | Sitemap | Contact