@Override
    public ByteBuf readBytes(int length) {
        checkReadableBytes(length);
        if (length == 0) {
            return Unpooled.EMPTY_BUFFER;
        }

        ByteBuf buf = alloc().buffer(length, maxCapacity);
        buf.writeBytes(this, readerIndex, length);
        readerIndex += length;
        return buf;
    }
@Test
    public void testReadBytesAfterRelease9() {
        assertThrows(IllegalReferenceCountException.class, new Executable() {
            @Override
            public void execute() throws IOException {
                releasedBuffer().readBytes(new ByteArrayOutputStream(), 1);
            }
        });
    }