code: protected void addDocument(final BsonDocument document, final BsonOutput bsonOutput,
                                 final FieldNameValidator validator) {
          addDocument(document, getCodec(document), EncoderContext.builder().build(), bsonOutput, validator,
                      settings.getMaxDocumentSize() + DOCUMENT_HEADROOM, null);
      }
docs: Appends a document to the message.
  
  @param document the document
  @param bsonOutput the output
  @param validator the field name validator