assertEquals("Lengths must match", tempEditsFile.length(),
ledger.getLength());
long tempFileCrc32 = IOUtils.copyBytesAndGenerateCRC(
new FileInputStream(tempEditsFile),
new NullOutputStream(),
(int) tempEditsFile.length(),
false);
long ledgerCrc32 = IOUtils.copyBytesAndGenerateCRC(
new LedgerInputStream(ledger),
new NullOutputStream(),
(int) ledger.getLength(),
false);
// Test that the same data (including a log version) has been written
// to both BookKeeperEditLogOutputStream and EditLogFileOutputStream