Example usage for io.netty.util ReferenceCountUtil release

List of usage examples for io.netty.util ReferenceCountUtil release

Introduction

In this page you can find the example usage for io.netty.util ReferenceCountUtil release.

Prototype

public static boolean release(Object msg, int decrement) 

Source Link

Document

Try to call ReferenceCounted#release(int) if the specified message implements ReferenceCounted .

Usage

From source file:org.apache.spark.network.protocol.MessageWithHeader.java

License:Apache License

@Override
public boolean release(int decrement) {
    header.release(decrement);/* ww  w.  j  a  va2 s  .  c  om*/
    ReferenceCountUtil.release(body, decrement);
    if (managedBuffer != null) {
        for (int i = 0; i < decrement; i++) {
            managedBuffer.release();
        }
    }
    return super.release(decrement);
}