
com.github.netty.protocol.dubbo.Body Maven / Gradle / Ivy
package com.github.netty.protocol.dubbo;
import io.netty.buffer.ByteBuf;
public abstract class Body {
ByteBuf bodyBytes;
int markReaderIndex;
public ByteBuf encode() {
if (bodyBytes != null) {
bodyBytes.readerIndex(markReaderIndex);
}
return bodyBytes;
}
public boolean release() {
if (bodyBytes != null && bodyBytes.refCnt() > 0) {
return bodyBytes.release();
} else {
return false;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy