aeron-samples/src/main/java/io/aeron/samples/MultipleSubscribersWithFragmentAssembly.java
public static FragmentHandler reassembledStringMessage1(final int streamId)
    {
        return (buffer, offset, length, header) ->
        {
            final byte[] data = new byte[length];
            buffer.getBytes(offset, data);

            System.out.format(
                "message to stream %d from session %x term id %x term offset %d (%d@%d)%n",
                streamId, header.sessionId(), header.termId(), header.termOffset(), length, offset);

            if (length != 10000)
            {
                System.out.format(
                    "Received message was not assembled properly;" +
                    " received length was %d, but was expecting 10000%n",
                    length);
            }
        };
    }
public static FragmentHandler reassembledStringMessage1(final int streamId)
    {
        return (buffer, offset, length, header) ->
        {
            final byte[] data = new byte[length];
            buffer.getBytes(offset, data);

            System.out.format(
                "message to stream %d from session %x term id %x term offset %d (%d@%d)%n",
                streamId, header.sessionId(), header.termId(), header.termOffset(), length, offset);

            if (length != 10000)
            {
                System.out.format(
                    "Received message was not assembled properly;" +
                    " received length was %d, but was expecting 10000%n",
                    length);
            }
        };
    }
public static FragmentHandler reassembledStringMessage1 ( final int streamId ) { return ( buffer , offset , length , header ) -> { final byte [ ] data = new byte [ length ] ; buffer . getBytes ( offset , data ) ; System . out . format ( "message to stream %d from session %x term id %x term offset %d (%d@%d)%n" , streamId , header . sessionId ( ) , header . termId ( ) , header . termOffset ( ) , length , offset ) ; if ( length != 10000 ) { System . out . format ( "Received message was not assembled properly;" + " received length was %d, but was expecting 10000%n" , length ) ; } } ; }
Return a reusable, parameterized {@link FragmentHandler} that prints to stdout for the first stream(STREAM)

@param streamId to show when printing
@return subscription data handler function that prints the message contents
Return a reusable parameterized { @link FragmentHandler } that prints to stdout for the first stream ( STREAM )