August 1999
Intermediate to advanced
1488 pages
72h 53m
English
File.stringToByte(string)
The stringToByte() method of the File object is used to convert the first character of the string passed to its binary equivalent.
Listing 8.86 opens two files, one for reading and the other for appending. Strings are then read using the read() method from the first file, converted back to byte characters using the stringToByte() method, and then written to the second file. Both files are closed when the process has completed.
<SERVER> // Open a log file and a summary file var myLog = new File("/data/logs/today.dat"); var mySummary = new File("/data/logs/summary.dat"); // Open ... |
Read now
Unlock full access