code: @Override
      protected void writeToOutput(final Map<String, Object> row)
              throws IOException {
          if (generator == null) {
              ObjectMapper mapper = new ObjectMapper();
              BsonFactory factory = new BsonFactory(mapper);
              factory.enable(BsonGenerator.Feature.ENABLE_STREAMING);
              generator = factory.createJsonGenerator(getOutputStream());
              generator.writeStartArray(); // [
          }
  
          // Convert the tuple into a map
          generator.writeObject(row);
      }
docs: Write a row to the file.
  
  @param row A row of data.
  @throws java.io.IOException Thrown when there are problems writing to the
  destination.