code: public void write(String key, String document) throws IOException {
      try {
        // Write the key.
        outputStream.write(key.getBytes("UTF-8"));
  
        // Write the key-document keyDocumentDelimiter.
        outputStream.write(keyDocumentDelimiter.getBytes("UTF-8"));
  
        // Write the document.
        outputStream.write(document.getBytes("UTF-8"));
  
        // Write the row keyDocumentDelimiter.
        outputStream.write(rowDelimiter.getBytes("UTF-8"));
      } catch (UnsupportedEncodingException e) { LOGGER.error("Shouldn't happen."); }
    }
docs: Write a Couchbase document
  @param key Couchbase document ID
  @param document Couchbase document value
  @throws IOException in case of issues while writing to a file