static void dissectFrame(
        final DriverEventCode eventCode,
        final MutableDirectBuffer buffer,
        final int offset,
        final StringBuilder builder)
    {
        int encodedLength = dissectLogHeader(CONTEXT, eventCode, buffer, offset, builder);

        builder.append(": address=");

        encodedLength += dissectSocketAddress(buffer, offset + encodedLength, builder);

        builder.append(" ");

        final int frameOffset = offset + encodedLength;
        final int frameType = frameType(buffer, frameOffset);
        switch (frameType)
        {
            case HeaderFlyweight.HDR_TYPE_PAD:
            case HeaderFlyweight.HDR_TYPE_DATA:
                DATA_HEADER.wrap(buffer, frameOffset, buffer.capacity() - frameOffset);
                dissectDataFrame(builder);
                break;

            case HeaderFlyweight.HDR_TYPE_SM:
                SM_HEADER.wrap(buffer, frameOffset, buffer.capacity() - frameOffset);
                dissectStatusFrame(builder);
                break;

            case HeaderFlyweight.HDR_TYPE_NAK:
                NAK_HEADER.wrap(buffer, frameOffset, buffer.capacity() - frameOffset);
                dissectNakFrame(builder);
                break;

            case HeaderFlyweight.HDR_TYPE_SETUP:
                SETUP_HEADER.wrap(buffer, frameOffset, buffer.capacity() - frameOffset);
                dissectSetupFrame(builder);
                break;

            case HeaderFlyweight.HDR_TYPE_RTTM:
                RTT_MEASUREMENT.wrap(buffer, frameOffset, buffer.capacity() - frameOffset);
                dissectRttFrame(builder);
                break;

            case HeaderFlyweight.HDR_TYPE_RES:
                dissectResFrame(buffer, frameOffset, builder);
                break;

            case HeaderFlyweight.HDR_TYPE_RSP_SETUP:
                RSP_SETUP.wrap(buffer, frameOffset, buffer.capacity() - frameOffset);
                dissectRspSetupFrame(builder);
                break;

            default:
                builder.append("type=UNKNOWN(").append(frameType).append(")");
                break;
        }
    }
@Test
    void dissectFrameTypePad()
    {
        internalEncodeLogHeader(buffer, 0, 5, 5, () -> 1_000_000_000);
        final int socketAddressOffset = encodeSocketAddress(
            buffer, LOG_HEADER_LENGTH, new InetSocketAddress("localhost", 8080));
        final DataHeaderFlyweight flyweight = new DataHeaderFlyweight();
        flyweight.wrap(buffer, LOG_HEADER_LENGTH + socketAddressOffset, 300);
        flyweight.headerType(HDR_TYPE_PAD);
        flyweight.flags((short)13);
        flyweight.frameLength(100);
        flyweight.sessionId(42);
        flyweight.streamId(5);
        flyweight.termId(16);
        flyweight.termOffset(1045);

        dissectFrame(FRAME_IN, buffer, 0, builder);

        assertEquals("[1.000000000] " + CONTEXT + ": " + FRAME_IN.name() + " [5/5]: " +
            "address=127.0.0.1:8080 type=PAD flags=00001101 frameLength=100 sessionId=42 streamId=5 termId=16 " +
            "termOffset=1045",
            builder.toString());
    }