question: void writeToByteBuffer ( ByteBuffer buffer , boolean mb , boolean me ) { boolean sr = mPayload . length < 256 ; boolean il = mId . length > 0 ; byte flags = ( byte ) ( ( mb ? FLAG_MB : 0 ) | ( me ? FLAG_ME : 0 ) | ( sr ? FLAG_SR : 0 ) | ( il ? FLAG_IL : 0 ) | mTnf ) ; buffer . put ( flags ) ; buffer . put ( ( byte ) mType . length ) ; if ( sr ) { buffer . put ( ( byte ) mPayload . length ) ; } else { buffer . putInt ( mPayload . length ) ; } if ( il ) { buffer . put ( ( byte ) mId . length ) ; } buffer . put ( mType ) ; buffer . put ( mId ) ; buffer . put ( mPayload ) ; }
target:  Serialize record for network transmission.<p> Uses specified MB and ME flags.<p> Does not chunk records.