code: public static File copyToTempFile(InputStream serialization)
              throws IOException, FileNotFoundException {
          File tempFile = createTempFile();
          StreamUtility.pipeStream(serialization,
                                   new FileOutputStream(tempFile),
                                   4096);
          return tempFile;
      }
docs: Copy an input stream to a temporary file, so we can hand an input stream
  to the delegate and have another input stream for the journal.