Example usage for io.netty.buffer AbstractReferenceCountedByteBuf refCnt

List of usage examples for io.netty.buffer AbstractReferenceCountedByteBuf refCnt

Introduction

In this page you can find the example usage for io.netty.buffer AbstractReferenceCountedByteBuf refCnt.

Prototype

int refCnt

To view the source code for io.netty.buffer AbstractReferenceCountedByteBuf refCnt.

Click Source Link

Usage

From source file:com.noctarius.tengi.buffer.ByteBufMemoryBuffer.java

License:Open Source License

@Override
public void free() {
    if (byteBuffer instanceof AbstractReferenceCountedByteBuf) {
        // Force a releasing of the underlying ByteBuf
        AbstractReferenceCountedByteBuf byteBuf = (AbstractReferenceCountedByteBuf) byteBuffer;
        byteBuf.release(byteBuf.refCnt());
    }/*from   ww  w.  j a  v a2 s.com*/
}