Package org.eclipse.jetty.http
Class PreEncodedHttpField
java.lang.Object
org.eclipse.jetty.http.HttpField
org.eclipse.jetty.http.PreEncodedHttpField
- Direct Known Subclasses:
ResponseHttpFields.PersistentPreEncodedHttpField
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
ConstructorDescriptionPreEncodedHttpField
(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
Returns whether this field value, possibly multi-valued, contains the specified search string, case-insensitively.int
getEncodedLength
(HttpVersion version) int
long
void
putTo
(ByteBuffer bufferInFillMode, HttpVersion version) Methods inherited from class org.eclipse.jetty.http.HttpField
contains, containsLast, containsLast, equals, getHeader, getLowerCaseName, getName, getValue, getValueList, getValueParameters, getValues, hashCode, is, isSameName, stripParameters, toString, valueParameters, withoutValue, withValue, withValues
-
Constructor Details
-
PreEncodedHttpField
-
PreEncodedHttpField
-
PreEncodedHttpField
-
PreEncodedHttpField
-
PreEncodedHttpField
-
-
Method Details
-
putTo
-
getEncodedLength
-
contains
Description copied from class:HttpField
Returns whether this field value, possibly multi-valued, contains the specified search string, case-insensitively.
Only values, and not parameters, are compared with the search string.
-
getIntValue
public int getIntValue()- Overrides:
getIntValue
in classHttpField
- Returns:
- the value of this field as an
int
-
getLongValue
public long getLongValue()- Overrides:
getLongValue
in classHttpField
- Returns:
- the value of this field as an
long
-