Java I/O
FileOutputputStream os = new FileOutputStream("Temp1.tmp"); //CDC32 extends Checksum. CRC32 crc32 = new CRC32(); CheckedOutputStream cos = new CheckedOutputStream(os, crc32); cos.write(1); cos.write(2); //Get the checksum for this file long crc = crc32.getValue(); //Write this checksum to the stream. cos.write(crc);
9 of 13