public void compile ( ) { if ( compiledSize == 0 ) { ByteBuffer bb = m_container . b ( ) ; compiledSize = bb . position ( ) ; bb . flip ( ) ; m_allocator . track ( compiledSize ) ; } if ( log . isTraceEnabled ( ) ) { StringBuilder sb = new StringBuilder ( "Compiling buffer: " ) ; ByteBuffer dup = m_container . bDR ( ) ; while ( dup . hasRemaining ( ) ) { sb . append ( " " ) . append ( dup . get ( ) ) ; } log . trace ( sb . toString ( ) ) ; } }
Generate the byte array in preparation of moving over a message bus . Idempotent but not thread - safe . Also changes state to immutable .