private boolean checkBinData(ByteBuffer data) {
        int totalLen = data.getInt(BIN_MSG_TOTALLEN_OFFSET);
        int bodyLen = data.getInt(BIN_MSG_BODYLEN_OFFSET);
        int attrLen = data.getShort(BIN_MSG_BODY_OFFSET + bodyLen);
        int msgMagic = (data.getShort(BIN_MSG_BODY_OFFSET + bodyLen
                + BIN_MSG_ATTRLEN_SIZE + attrLen) & 0xFFFF);

        if ((totalLen + BIN_MSG_TOTALLEN_SIZE != (bodyLen + attrLen + BIN_MSG_FORMAT_SIZE))
                || (msgMagic != BIN_MSG_MAGIC)) {
            return false;
        }

        return true;
    }
add msg
@param attr
@param data
@return
inlong-common/src/main/java/org/apache/inlong/common/msg/InLongMsg.java