public int getMessageLength ( ) { // Message type int messageLength = 1 ; // Number of aliases messageLength += 4 ; if ( this . aliases != null ) { for ( AttributeAlias alias : this . aliases ) { // Alias number, name length messageLength += 8 ; try { messageLength += alias . attributeName . getBytes ( "UTF-16BE" ) . length ; } catch ( UnsupportedEncodingException e ) { log . error ( "Unable to encode strings into UTF-16." ) ; e . printStackTrace ( ) ; } } } return messageLength ; }
Returns the length of this message as encoded according to the Client - World Model protocol .