protected void load() throws IOException {
  long sequenceNumber=readUInt();
  if (sequenceNumber != expectedSequenceNumber) {
    throw new IllegalStateException("Expected sequence number " + expectedSequenceNumber + " got "+ sequenceNumber);
  }
  expectedSequenceNumber++;
  byte[] hash=new byte[HASH_SIZE];
  readFully(hash);
  long readLength=readUInt();
  if (readLength < 0) {
    throw new IllegalStateException("Got negative length for block");
  }
  if (readLength == 0) {
    if (!Arrays.equals(hash,ZERO_HASH)) {
      throw new IllegalStateException("Block hash was not zero on final block");
    }
    done=true;
    return;
  }
  byte[] readBuffer=new byte[(int)readLength];
  readFully(readBuffer);
  md5.update(readBuffer);
  if (!Arrays.equals(md5.digest(),hash)) {
    throw new IllegalStateException("MD5 check failed while reading HashBlock");
  }
  blockInputStream=new ByteArrayInputStream(readBuffer);
}

protected void load ( ) throws IOException { long sequenceNumber = readUInt ( ) ; if ( sequenceNumber != expectedSequenceNumber ) { throw new IllegalStateException ( "Expected sequence number " + expectedSequenceNumber + " got " + sequenceNumber ) ; } expectedSequenceNumber ++ ; byte [ ] hash = new byte [ HASH_SIZE ] ; readFully ( hash ) ; long readLength = readUInt ( ) ; if ( readLength < 0 ) { throw new IllegalStateException ( "Got negative length for block" ) ; } if ( readLength == 0 ) { if ( ! Arrays . equals ( hash , ZERO_HASH ) ) { throw new IllegalStateException ( "Block hash was not zero on final block" ) ; } done = true ; return ; } byte [ ] readBuffer = new byte [ ( int ) readLength ] ; readFully ( readBuffer ) ; md5 . update ( readBuffer ) ; if ( ! Arrays . equals ( md5 . digest ( ) , hash ) ) { throw new IllegalStateException ( "MD5 check failed while reading HashBlock" ) ; } blockInputStream = new ByteArrayInputStream ( readBuffer ) ; }
reload the internal buffer from the underlying input stream
