code: public static void saveMD5File(File dataFile, MD5Hash digest)
        throws IOException {
      File md5File = getDigestFileForFile(dataFile);
      String digestString = StringUtils.byteToHexString(
          digest.getDigest());
      String md5Line = digestString + " *" + dataFile.getName() + "\n";
      
      AtomicFileOutputStream afos = new AtomicFileOutputStream(md5File);
      afos.write(md5Line.getBytes());
      afos.close();
      LOG.info("Saved MD5 " + digest + " to " + md5File);
    }
docs: Save the ".md5" file that lists the md5sum of another file.
  @param dataFile the original file whose md5 was computed
  @param digest the computed digest
  @throws IOException