@SuppressWarnings("deprecation")
    @Override
    public ByteBuf asReadOnly() {
        if (isReadOnly()) {
            return this;
        }
        return Unpooled.unmodifiableBuffer(this);
    }
@Test
    public void testReadyOnlyNioBuffersWithPositionLength() {
        assertReadyOnlyNioBuffersWithPositionLength(buffer.asReadOnly());
    }