question: private void sendMessages ( ) { List < MurmurMessage > messages = getMessages ( 0 ) ; MurmurMessage exchangeInfoMessage = new MurmurMessage ( "ExchangeAgreement" , Integer . toString ( messages . size ( ) ) , 1d ) ; if ( lengthValueWrite ( out , exchangeInfoMessage . toJSON ( MurmurApplication . getContext ( ) , 0 , 0 ) ) ) { for ( MurmurMessage message : messages ) { List < MurmurMessage > packet = new ArrayList < > ( ) ; packet . add ( message ) ; CleartextMessages messagesMessage = new CleartextMessages ( ( ArrayList < MurmurMessage > ) packet ) ; lengthValueWrite ( out , messagesMessage . toJson ( MurmurApplication . getContext ( ) ) ) ; } } }
target:  Get messages from the MessageStore, encode them as a CleartextMessages protobuf object, and write that Message out to the output stream.