java.lang.Object
org.eclipse.jetty.http.HttpField
org.eclipse.jetty.http.PreEncodedHttpField
Pre encoded HttpField.
An HttpField that will be cached and used many times can be created as
a PreEncodedHttpField
, which will use the HttpFieldPreEncoder
instances discovered by the ServiceLoader
to pre-encode the header
for each version of HTTP in use. This will save garbage
and CPU each time the field is encoded into a response.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.http.HttpField
HttpField.IntValueHttpField, HttpField.LongValueHttpField
-
Field Summary
Fields inherited from class org.eclipse.jetty.http.HttpField
NAME_VALUE_TOKENIZER, PARAMETER_TOKENIZER
-
Constructor Summary
ConstructorsConstructorDescriptionPreEncodedHttpField
(String name, long value) PreEncodedHttpField
(String name, String value) PreEncodedHttpField
(HttpHeader header, long value) PreEncodedHttpField
(HttpHeader header, String value) PreEncodedHttpField
(HttpHeader header, String name, String value) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Look for a value in a possible multivalued fieldint
getEncodedLength
(HttpVersion version) int
long
void
putTo
(ByteBuffer bufferInFillMode, HttpVersion version) Methods inherited from class org.eclipse.jetty.http.HttpField
contains, equals, getHeader, getLowerCaseName, getName, getValue, getValueList, getValueParameters, getValues, hashCode, is, isSameName, stripParameters, toString, valueParameters
-
Constructor Details
-
PreEncodedHttpField
-
PreEncodedHttpField
-
PreEncodedHttpField
-
PreEncodedHttpField
-
PreEncodedHttpField
-
-
Method Details
-
putTo
-
getEncodedLength
-
contains
Description copied from class:HttpField
Look for a value in a possible multivalued field- Overrides:
contains
in classHttpField
- Parameters:
search
- Values to search for (case-insensitive)- Returns:
- True iff the value is contained in the field value entirely or as an element of a quoted comma separated list. List element parameters (eg qualities) are ignored, except if they are q=0, in which case the item itself is ignored.
-
getIntValue
public int getIntValue()- Overrides:
getIntValue
in classHttpField
-
getLongValue
public long getLongValue()- Overrides:
getLongValue
in classHttpField
-