public void encode ( final BsonOutput bsonOutput , final SessionContext sessionContext ) { notNull ( "sessionContext" , sessionContext ) ; int messageStartPosition = bsonOutput . getPosition ( ) ; writeMessagePrologue ( bsonOutput ) ; EncodingMetadata encodingMetadata = encodeMessageBodyWithMetadata ( bsonOutput , sessionContext ) ; backpatchMessageLength ( messageStartPosition , bsonOutput ) ; this . encodingMetadata = encodingMetadata ; }
Encoded the message to the given output .