Top Description Fields Constructors Methods
org.eclipse.jetty.http

public Class PreEncodedHttpField

extends HttpField
Class Inheritance
Imports
java.nio.ByteBuffer, java.util.EnumMap, .ServiceLoader, org.eclipse.jetty.util.TypeUtil, org.slf4j.Logger, .LoggerFactory

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.

Field Summary

Modifier and TypeField and Description
private static final EnumMap<HttpVersion, HttpFieldPreEncoder>
private final EnumMap<HttpVersion, byte[]>
private final long
private static final Logger
Inherited from org.eclipse.jetty.http.HttpField:
NAME_VALUE_TOKENIZERPARAMETER_TOKENIZER

Constructor Summary

AccessConstructor and Description
private
PreEncodedHttpField(HttpHeader header, String name, String value, long longValue)

public
public
public
PreEncodedHttpField(HttpHeader header, long value)

public
public
PreEncodedHttpField(String name, long value)

Method Summary

Modifier and TypeMethod and Description
public boolean
contains(String
the string to search for
search
)

Overrides org.eclipse.jetty.http.HttpField.contains.

Returns whether this field value, possibly multi-valued, contains the specified search string, case-insensitively.

public int
public int
public long
public void
putTo(ByteBuffer bufferInFillMode, HttpVersion version)

Inherited from org.eclipse.jetty.http.HttpField:
containscontainsLastcontainsLastequalsgetHeadergetLowerCaseNamegetNamegetValuegetValueListgetValueParametersgetValueshashCodeisisSameNamestripParameterstoStringvalueParameters

Field Detail

__encodersback to summary
private static final EnumMap<HttpVersion, HttpFieldPreEncoder> __encoders
_encodedFieldsback to summary
private final EnumMap<HttpVersion, byte[]> _encodedFields
_longValueback to summary
private final long _longValue
LOGback to summary
private static final Logger LOG

Constructor Detail

PreEncodedHttpFieldback to summary
private PreEncodedHttpField(HttpHeader header, String name, String value, long longValue)
PreEncodedHttpFieldback to summary
public PreEncodedHttpField(HttpHeader header, String name, String value)
PreEncodedHttpFieldback to summary
public PreEncodedHttpField(HttpHeader header, String value)
PreEncodedHttpFieldback to summary
public PreEncodedHttpField(HttpHeader header, long value)
PreEncodedHttpFieldback to summary
public PreEncodedHttpField(String name, String value)
PreEncodedHttpFieldback to summary
public PreEncodedHttpField(String name, long value)

Method Detail

containsback to summary
public boolean contains(String search)

Overrides org.eclipse.jetty.http.HttpField.contains.

Doc from org.eclipse.jetty.http.HttpField.contains.

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.

Parameters
search:String

the string to search for

Returns:boolean

whether this field value, possibly multi-valued, contains the specified search string

Annotations
@Override
getEncodedLengthback to summary
public int getEncodedLength(HttpVersion version)
getIntValueback to summary
public int getIntValue()

Overrides org.eclipse.jetty.http.HttpField.getIntValue.

Returns:int

Doc from org.eclipse.jetty.http.HttpField.getIntValue.

the value of this field as an int

Annotations
@Override
getLongValueback to summary
public long getLongValue()

Overrides org.eclipse.jetty.http.HttpField.getLongValue.

Returns:long

Doc from org.eclipse.jetty.http.HttpField.getLongValue.

the value of this field as an long

Annotations
@Override
putToback to summary
public void putTo(ByteBuffer bufferInFillMode, HttpVersion version)