@Override
    public final Buffer readUntilSafe(final int maxBytes, final byte... bytes) throws IOException, IllegalArgumentException {
        final int index = indexOf(maxBytes, bytes);
        if (index == -1) {
            return null;
        }

        final int size = index - getReaderIndex();
        Buffer result = null;
        if (size == 0) {
            result = Buffers.EMPTY_BUFFER;
        } else {
            result = readBytes(size);
        }
        readByte(); // consume the one at the index as well
        return result;
    }
@ Override public final Buffer readUntilSafe ( final int maxBytes , final byte ... bytes ) throws IOException , IllegalArgumentException { final int index = indexOf ( maxBytes , bytes ) ; if ( index == - 1 ) { return null ; } final int size = index - getReaderIndex ( ) ; Buffer result = null ; if ( size == 0 ) { result = Buffers . EMPTY_BUFFER ; } else { result = readBytes ( size ) ; } readByte ( ) ; return result ; }
{@inheritDoc}