The easiest way is to convert each character to a hexadecimal representation of the original text, and write that to disc. The only downside to this is that the size doubles. IE, 10 characters of input data will result in 20 characters of output data. To read it back, you read 2 characters at a time, and then convert that to an integer value, cast to a char, and append that to a string. The actual coding for this I leave to you. Once you make an effort to code it, we will be happy to help with any problems you may have.
rubberman
Posting Maven
2,571 posts since Mar 2010
Reputation Points: 365
Solved Threads: 305
Skill Endorsements: 51
rubberman: don't forget that Java chars are Unicode, 16 bits per char, four hex digits not two.
JamesCherrill
... trying to help
8,497 posts since Apr 2008
Reputation Points: 2,583
Solved Threads: 1,454
Skill Endorsements: 29
True enough James - thanks for the reminder! So, you may have to do some additional bit-twiddling to do that. In C/C++ this is pretty standard cruft... :-)
rubberman
Posting Maven
2,571 posts since Mar 2010
Reputation Points: 365
Solved Threads: 305
Skill Endorsements: 51