int typeId = header.getInt() ;
int len = header.getInt() ;
int ref = header.getInt() ;
int blockId = header.getInt() ;
Adler32 adler = new Adler32() ;
adler.update(header.array()) ;
ByteBuffer bb = ByteBuffer.allocate(len) ;
lenRead = channel.read(bb) ;
if ( lenRead != len)
throw new TDBTransactionException("Failed to read the journal entry: wanted "+len+" bytes, got "+lenRead) ;
adler.update(bb.array()) ;
bb.rewind() ;
// checksum
crcTrailer.clear() ;
lenRead = channel.read(crcTrailer) ;
if ( lenRead != SizeofCRC )
throw new TDBTransactionException("Failed to read block checksum (got "+lenRead+" bytes, not "+SizeofCRC+").") ;
int checksum = Bytes.getInt(crcTrailer.array()) ;
if ( checksum != (int)adler.getValue() )
throw new TDBTransactionException("Checksum error reading from the Journal.") ;
JournalEntryType type = JournalEntryType.type(typeId) ;
FileRef fileRef = FileRef.get(ref) ;