nl_tokens: Dump the contents of a segment file to a { @link PrintStream } .
pl_tokens: public static void dumpSegment ( final PrintStream out , final int messageDumpLimit , final UnsafeBuffer buffer ) { final DataHeaderFlyweight dataHeaderFlyweight = new DataHeaderFlyweight ( ) ; final int length = buffer . capacity ( ) ; int offset = 0 ; while ( offset < length ) { dataHeaderFlyweight . wrap ( buffer , offset , length - offset ) ; out . println ( offset + ": " + dataHeaderFlyweight . toString ( ) ) ; final int frameLength = dataHeaderFlyweight . frameLength ( ) ; if ( frameLength < DataHeaderFlyweight . HEADER_LENGTH ) { break ; } final int limit = <mask> ( frameLength - HEADER_LENGTH , messageDumpLimit ) ; out . println ( LogInspector . formatBytes ( buffer , offset + HEADER_LENGTH , limit ) ) ; offset += BitUtil . align ( frameLength , FrameDescriptor . FRAME_ALIGNMENT ) ; } }