public boolean addMsg(ByteBuffer data) {
        if (!checkBinData(data)) {
            return false;
        }

        if (binMsgBuffer != null) {
            return false;
        }

        binMsgBuffer = ByteBuffer.allocate(data.remaining());
        binMsgBuffer.put(data);

        binMsgBuffer.position(BIN_MSG_TOTALLEN_OFFSET);
        msgcnt = getBinMsgCnt(binMsgBuffer);
        return true;
    }
add msg
@param attr
@param data
@return
inlong-common/src/main/java/org/apache/inlong/common/msg/InLongMsg.java