Package gov.nist.javax.sip.header

Examples of gov.nist.javax.sip.header.ContentType


                ContentLengthHeader.NAME.length()  < 1300) {

            /*
             * Check to see we are within one UDP packet.
             */
            ContentTypeHeader cth = new ContentType("message", "sipfrag");
            buf.append("\r\n" + cth.toString());
            ContentLength clengthHeader = new ContentLength(clength);
            buf.append("\r\n" + clengthHeader.toString());
            buf.append("\r\n\r\n" + badReq);
        } else {
            ContentLength clengthHeader = new ContentLength(0);
View Full Code Here


     * @param messageContent is the messge content as a string.
     */
    public void setMessageContent(String type, String subType, String messageContent) {
        if (messageContent == null)
            throw new IllegalArgumentException("messgeContent is null");
        ContentType ct = new ContentType(type, subType);
        this.setHeader(ct);
        this.messageContent = messageContent;
        this.messageContentBytes = null;
        this.messageContentObject = null;
        // Could be double byte so we need to compute length
View Full Code Here

     * @param type is the messge type.
     * @param subType is the message subType.
     * @param messageContent is the message content as a byte array.
     */
    public void setMessageContent(String type, String subType, byte[] messageContent) {
        ContentType ct = new ContentType(type, subType);
        this.setHeader(ct);
        this.setMessageContent(messageContent);

        computeContentLength(messageContent);
    }
View Full Code Here

    /**
     * Returns the charset to use for encoding/decoding the body of this message
     */
    protected final String getCharset() {
        ContentType ct = getContentTypeHeader();
        if (ct!=null) {
            String c = ct.getCharset();
            return c!=null ? c : contentEncodingCharset;
        } else return contentEncodingCharset;
    }
View Full Code Here

     * @param messageContent is the messge content as a string.
     */
    public void setMessageContent(String type, String subType, String messageContent) {
        if (messageContent == null)
            throw new IllegalArgumentException("messgeContent is null");
        ContentType ct = new ContentType(type, subType);
        this.setHeader(ct);
        this.messageContent = messageContent;
        this.messageContentBytes = null;
        this.messageContentObject = null;
        // Could be double byte so we need to compute length
View Full Code Here

     * @param type is the messge type.
     * @param subType is the message subType.
     * @param messageContent is the message content as a byte array.
     */
    public void setMessageContent(String type, String subType, byte[] messageContent) {
        ContentType ct = new ContentType(type, subType);
        this.setHeader(ct);
        this.setMessageContent(messageContent);

        computeContentLength(messageContent);
    }
View Full Code Here

    /**
     * Returns the charset to use for encoding/decoding the body of this message
     */
    protected final String getCharset() {
      ContentType ct = getContentTypeHeader();
      if (ct!=null) {
        String c = ct.getCharset();
        return c!=null ? c : contentEncodingCharset;
      } else return contentEncodingCharset;
    }
View Full Code Here

     * @param messageContent is the messge content as a string.
     */
    public void setMessageContent(String type, String subType, String messageContent) {
        if (messageContent == null)
            throw new IllegalArgumentException("messgeContent is null");
        ContentType ct = new ContentType(type, subType);
        this.setHeader(ct);
        this.messageContent = messageContent;
        this.messageContentBytes = null;
        this.messageContentObject = null;
        // Could be double byte so we need to compute length
View Full Code Here

     * @param type is the messge type.
     * @param subType is the message subType.
     * @param messageContent is the message content as a byte array.
     */
    public void setMessageContent(String type, String subType, byte[] messageContent) {
        ContentType ct = new ContentType(type, subType);
        this.setHeader(ct);
        this.setMessageContent(messageContent);

        computeContentLength(messageContent);
    }
View Full Code Here

    /**
     * Returns the charset to use for encoding/decoding the body of this message
     */
    protected final String getCharset() {
        ContentType ct = getContentTypeHeader();
        if (ct!=null) {
            String c = ct.getCharset();
            return c!=null ? c : contentEncodingCharset;
        } else return contentEncodingCharset;
    }
View Full Code Here

TOP

Related Classes of gov.nist.javax.sip.header.ContentType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.