code: public void finish() throws IOException {
      if (finished) {
        return;
      }
      finished = true;
      sum.writeValue(barray, 0, false);
      out.write (barray, 0, sum.getChecksumSize());
      out.flush();
    }
docs: Finishes writing data to the output stream, by writing
  the checksum bytes to the end. The underlying stream is not closed.
  @throws IOException