public int putMessgeWithoutEncode ( List < DataSlice > messageParts ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "putMessgeWithoutEncode" , messageParts ) ; int messageLength = 0 ; // Now we have a list of MessagePart objects. First work out the overall length. for ( int x = 0 ; x < messageParts . size ( ) ; x ++ ) { messageLength += messageParts . get ( x ) . getLength ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Message is " + messageLength + "byte(s) in length" ) ; // Write the length putLong ( messageLength ) ; // Now take the message parts and wrap them into byte buffers using the offset's supplied for ( int x = 0 ; x < messageParts . size ( ) ; x ++ ) { DataSlice messPart = messageParts . get ( x ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "DataSlice[" + x + "]: " + "Array: " + Arrays . toString ( messPart . getBytes ( ) ) + ", " + "Offset: " + messPart . getOffset ( ) + ", " + "Length: " + messPart . getLength ( ) ) ; wrap ( messPart . getBytes ( ) , messPart . getOffset ( ) , messPart . getLength ( ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "putMessgeWithoutEncode" , messageLength ) ; return messageLength ; }
This method is used to put a message into the buffer but assumes that the encode has already been completed . This may be in the case where we would like to send the message in chunks but we decide that the message would be better sent as an entire message .