August 1999
Intermediate to advanced
1488 pages
72h 53m
English
file.writeByte(byte)
The writeByte() method of the File object writes the byte passed to the method to the file on which it was invoked. The method returns true if it was successful and false otherwise. You should use the readByte() method to read any byte information from other files that you want to write. If you need to write text information, use the write() method.
Listing 8.88 reads data out of a binary file and writes it to another file.
<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 the log file for reading and the ... |
Read now
Unlock full access