JSIP API v1.2
November 2006

javax.sip.header
Interface ContentLengthHeader

All Superinterfaces:
java.lang.Cloneable, Header, java.io.Serializable

public interface ContentLengthHeader
extends Header

The Content-Length header field indicates the size of the message-body, in decimal number of octets, sent to the recipient. Applications SHOULD use this field to indicate the size of the message-body to be transferred, regardless of the media type of the entity. If a stream-based protocol (such as TCP) is used as transport, the header field MUST be used.

The size of the message-body does not include the CRLF separating header fields and body. Any Content-Length greater than or equal to zero is a valid value. If no body is present in a message, then the Content-Length header field value MUST be set to zero.

Author:
BEA Systems, NIST
See Also:
ContentDispositionHeader, ContentTypeHeader, ContentEncodingHeader, ContentLanguageHeader

Field Summary
static java.lang.String NAME
          Name of ContentLengthHeader
 
Method Summary
 int getContentLength()
          Gets content-length of the message body.
 void setContentLength(int contentLength)
          Set content-length of ContentLengthHeader.
 
Methods inherited from interface javax.sip.header.Header
clone, equals, getName, hashCode, toString
 

Field Detail

NAME

static final java.lang.String NAME
Name of ContentLengthHeader

See Also:
Constant Field Values
Method Detail

setContentLength

void setContentLength(int contentLength)
                      throws InvalidArgumentException
Set content-length of ContentLengthHeader. The content-length must be greater than or equal to zero.

Parameters:
contentLength - the content-length of the message body as a decimal number of octets.
Throws:
InvalidArgumentException - if contentLength is less than zero.

getContentLength

int getContentLength()
Gets content-length of the message body.

Returns:
content-length of the message body as a decimal number of octets.

JSIP API v1.2
November 2006

If you have any comments, please mail them to JAIN-SIP-INTEREST@java.sun.com after subscribing at http://archives.java.sun.com
Copyright - 2006 BEA Systems and Sun Microsystems