public CounterMessageFlyweight keyBuffer(final DirectBuffer keyBuffer, final int keyOffset, final int keyLength)
    {
        buffer.putInt(offset + KEY_LENGTH_OFFSET, keyLength);
        if (null != keyBuffer && keyLength > 0)
        {
            buffer.putBytes(offset + KEY_BUFFER_OFFSET, keyBuffer, keyOffset, keyLength);
        }

        return this;
    }
@Test
    void keyBuffer()
    {
        final int offset = 24;
        buffer.setMemory(0, offset, (byte)15);
        flyweight.wrap(buffer, offset);

        flyweight.keyBuffer(newBuffer(16), 4, 8);

        assertEquals(8, flyweight.keyBufferLength());
        assertEquals(KEY_BUFFER_OFFSET, flyweight.keyBufferOffset());
    }