/** Set the message content for a given type and subtype. * *@param type is the messge type. *@param subType is the message subType. *@param messageContent is the message content as a byte array. */ func (this *SIPMessage) SetMessageContent3(t string, subType string, messageContent []byte) { ct := header.NewContentTypeFromString(t, subType) this.SetHeader(ct) this.SetMessageContentFromByte(messageContent) //try { this.contentLengthHeader.SetContentLength(len(messageContent)) //} catch (InvalidArgumentException ex) {} }
/** Set the message content given type and subtype. * *@param type is the message type (eg. application) *@param subType is the message sybtype (eg. sdp) *@param messageContent is the messge content as a string. */ func (this *SIPMessage) SetMessageContentFromString(t string, subType string, messageContent string) { //if (messageContent == nil) // throw new IllegalArgumentException("messgeContent is nil"); ct := header.NewContentTypeFromString(t, subType) this.SetHeader(ct) this.messageContent = messageContent this.messageContentBytes = nil this.messageContentObject = nil //try { this.contentLengthHeader.SetContentLength(len(messageContent)) //} catch (InvalidArgumentException ex) {} }