(OutputStream out)
| 254 | |
| 255 | |
| 256 | public void writeHeader(OutputStream out) throws IOException { |
| 257 | byte[] header = getHeader(); |
| 258 | |
| 259 | // Ensure we've moved from tmpdata to data |
| 260 | getData(); |
| 261 | |
| 262 | // Generate the checksum and store |
| 263 | int crc = CRCUtils.getCRC(header); |
| 264 | if(data != null && data.length > 0) { |
| 265 | crc = CRCUtils.getCRC(data, crc); |
| 266 | } |
| 267 | IOUtils.putInt4(header, 22, crc); |
| 268 | checksum = crc; |
| 269 | |
| 270 | // Write out |
| 271 | out.write(header); |
| 272 | } |
| 273 | /** |
| 274 | * Gets the header, but with a blank CRC field |
| 275 | */ |