private boolean procEventBodyInfo(TcpEventInfo eventInfo, ProcessResult procResult, EncodeObject encObject) {
        // encode message body
        byte[] body = encBodyList(senderId, encObject.getMsgType(),
                tcpConfig.isSeparateEventByLF(), eventInfo, procResult);
        if (body == null) {
            return false;
        }
        // compress body
        if (encObject.isCompress()) {
            body = compressBodyInfo(senderId, body, procResult);
            if (body == null) {
                return false;
            }
        }
        // encrypt body
        if (tcpConfig.isEnableReportEncrypt()) {
            body = aesEncryptBodyInfo(senderId, body, encObject.getAesKey(), procResult);
            if (body == null) {
                return false;
            }
        }
        encObject.setBodyData(eventInfo.getMsgCnt(), body);
        return true;
    }
TCP Message Sender class

Used to define the TCP sender common methods
inlong-sdk/dataproxy-sdk/src/main/java/org/apache/inlong/sdk/dataproxy/sender/tcp/InLongTcpMsgSender.java