package net.openhft.chronicle.bytes;

import java.io.Closeable;

public interface RingBufferReader extends RingBufferReaderStats, Closeable {

    boolean isEmpty();

    boolean isClosed();

    @Override
    void close();

    /**
     * the readPosition and readLimit will be adjusted so that the client can read the data
     *
     * @param bytes who's byteStore must be the ring buffer,
     * @return nextReadPosition which should be passed to {@link RingBufferReader#afterRead(long)}
     */
    @SuppressWarnings("rawtypes")
    long beforeRead(Bytes bytes);

    void afterRead(long next);

    /**
     * @return the byteStore which backs the ring buffer
     */
    @SuppressWarnings("rawtypes")
    BytesStore byteStore();
}

@@ -590,24 +590,260 @@
 ong next);%0A%0A
+    /**%0A     * Convenience method calls both %7B@link #beforeRead(Bytes)%7D and %7B@link #afterRead(long)%7D%0A     * @param bytes%0A     * @return whether read succeeded%0A     */%0A    @SuppressWarnings(%22rawtypes%22)%0A    boolean read(BytesOut bytes);%0A%0A
     /**%0A    

improve RingBufferReader API