NIST-SIP: The Reference Implementation for JAIN-SIP 1.2

javax.sip.header
Interface ContentLengthHeader

All Superinterfaces:
Cloneable, Header, Serializable
All Known Implementing Classes:
ContentLength

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.

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

Field Summary
static 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 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.

NIST-SIP: The Reference Implementation for JAIN-SIP 1.2

A product of the NIST/ITL Advanced Networking Technologies Division.
See conditions of use.
Submit a bug report or feature request.