code: public void write(String uri, String contentType, String hostIP,
              long fetchBeginTimeStamp, long recordLength, InputStream in,
              boolean enforceLength) throws IOException {
          preWriteRecordTasks();
          try {
              write(getMetaLine(uri, contentType, hostIP, fetchBeginTimeStamp,
                      recordLength).getBytes(UTF8));
              copyFrom(in, recordLength, enforceLength);
              if (in instanceof ReplayInputStream) {
                  // check for consumption of entire recorded material
                  long remaining = ((ReplayInputStream) in).remaining();
                  // Should be zero at this stage. If not, something is
                  // wrong.
                  if (remaining != 0) {
                      String message = "Gap between expected and actual: "
                              + remaining + LINE_SEPARATOR + DevUtils.extraInfo()
                              + " writing arc "
                              + this.getFile().getAbsolutePath();
                      DevUtils.warnHandle(new Throwable(message), message);
                      throw new IOException(message);
                  }
              }
              write(LINE_SEPARATOR);
          } finally {
              postWriteRecordTasks();
          }
      }
docs: Write a record with the given metadata/content.
  
  @param uri
  URI for metadata-line
  @param contentType
  MIME content-type for metadata-line
  @param hostIP
  IP for metadata-line
  @param fetchBeginTimeStamp
  timestamp for metadata-line
  @param recordLength
  length for metadata-line; also may be enforced
  @param in
  source InputStream for record content
  @param enforceLength
  whether to enforce the declared length; should be true
  unless intentionally writing bad records for testing
  @throws IOException