Class ContentLength
- All Implemented Interfaces:
- Serializable,- Cloneable,- Header,- NameValuePair
The length of the response body in octets (8-bit bytes).
Example
Content-Length: 348
RFC2616 Specification
The Content-Length entity-header field indicates the size of the entity-body, in decimal number of OCTETs, sent to the recipient or, in the case of the HEAD method, the size of the entity-body that would have been sent had the request been a GET.Content-Length = "Content-Length" ":" 1*DIGIT
An example is...
Content-Length: 3495
Applications SHOULD use this field to indicate the transfer-length of the message-body, unless this is prohibited by the rules in section 4.4.
Any Content-Length greater than or equal to zero is a valid value. Section 4.4 describes how to determine the length of a message-body if a Content-Length is not given.
Note that the meaning of this field is significantly different from the corresponding definition in MIME, where it is an optional field used within the "message/external-body" content-type. In HTTP, it SHOULD be sent whenever the message's length can be determined prior to being transferred, unless this is prohibited by the rules in section 4.4.
See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionContentLength(Long value) Constructor.ContentLength(String value) Constructor.ContentLength(Supplier<Long> value) Constructor with delayed value.
- 
Method SummaryModifier and TypeMethodDescriptionstatic ContentLengthStatic creator.static ContentLengthStatic creator.static ContentLengthStatic creator with delayed value.Methods inherited from class org.apache.juneau.http.header.BasicLongHeaderasLong, assertLong, getValue, of, of, of, orElse, toLongMethods inherited from class org.apache.juneau.http.header.BasicHeaderassertName, assertStringValue, asString, equals, equalsIgnoreCase, get, getElements, getName, hashCode, isNotEmpty, isPresent, of, of, orElse, toString
- 
Constructor Details- 
ContentLengthConstructor.- Parameters:
- value- The header value.
 Must be parsable using- Long.parseLong(String).
 Can be- null .
 
- 
ContentLengthConstructor.- Parameters:
- value- The header value.
 Can be- null .
 
- 
ContentLengthConstructor with delayed value.Header value is re-evaluated on each call to BasicLongHeader.getValue().- Parameters:
- value- The supplier of the header value.
 Can be- null .
 
 
- 
- 
Method Details- 
ofStatic creator.- Parameters:
- value- The header value.
 Must be parsable using- Long.parseLong(String).
 Can be- null .
- Returns:
- A new header bean, or null if the value isnull .
 
- 
ofStatic creator.- Parameters:
- value- The header value.
 Can be- null .
- Returns:
- A new header bean, or null if the value isnull .
 
- 
ofStatic creator with delayed value.Header value is re-evaluated on each call to BasicLongHeader.getValue().- Parameters:
- value- The supplier of the header value.
 Can be- null .
- Returns:
- A new header bean, or null if the value isnull .
 
 
-