code: private static void writeHeader(DataOutputStream out, 
                                    BlockMetadataHeader header) 
                                    throws IOException {
      out.writeShort(header.getVersion());
      header.getChecksum().writeHeader(out);
    }
docs: This writes all the fields till the beginning of checksum.
  @param out DataOutputStream
  @param header
  @return
  @throws IOException