private Sha256Hash calculateHash(){
  try {
    ByteArrayOutputStream bos=new UnsafeByteArrayOutputStream(HEADER_SIZE);
    writeHeader(bos);
    return new Sha256Hash(Utils.reverseBytes(doubleDigest(bos.toByteArray())));
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

private Sha256Hash calculateHash ( ) { try { ByteArrayOutputStream bos = new UnsafeByteArrayOutputStream ( HEADER_SIZE ) ; writeHeader ( bos ) ; return new Sha256Hash ( Utils . reverseBytes ( doubleDigest ( bos . toByteArray ( ) ) ) ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } }
calculates the block hash by serializing the block and hashing the resulting bytes .
