public static int read(final AtomicBuffer buffer, final ErrorConsumer consumer)
    {
        return read(buffer, consumer, 0);
    }
@Test
    void readShouldNotReadIfRemainingSpaceIsLessThanOneErrorPrefix()
    {
        final UnsafeBuffer buffer = new UnsafeBuffer(new byte[64]);
        final long lastTimestamp = 543495734L;
        final long firstTimestamp = lastTimestamp - 1000;
        final int count = 123;
        final int totalLength = 45;
        buffer.putInt(LENGTH_OFFSET, totalLength);
        buffer.putLong(LAST_OBSERVATION_TIMESTAMP_OFFSET, lastTimestamp);
        buffer.putLong(FIRST_OBSERVATION_TIMESTAMP_OFFSET, firstTimestamp);
        buffer.putInt(OBSERVATION_COUNT_OFFSET, count);
        buffer.putStringWithoutLengthAscii(ENCODED_ERROR_OFFSET, "abcdefghijklmnopqrstuvwxyz");
        buffer.putInt(totalLength + LENGTH_OFFSET, 12);
        final ErrorConsumer errorConsumer = mock(ErrorConsumer.class);

        assertEquals(1, ErrorLogReader.read(buffer, errorConsumer, 0));

        verify(errorConsumer).accept(count, firstTimestamp, lastTimestamp, "abcdefghijklmnopqrstu");
    }