public class PreEncodedHttpField extends 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.
HttpField.IntValueHttpField, HttpField.LongValueHttpField
Constructor and Description |
---|
PreEncodedHttpField(HttpHeader header,
String value) |
PreEncodedHttpField(HttpHeader header,
String name,
String value) |
PreEncodedHttpField(String name,
String value) |
Modifier and Type | Method and Description |
---|---|
void |
putTo(ByteBuffer bufferInFillMode,
HttpVersion version) |
contains, equals, getHeader, getIntValue, getLongValue, getLowerCaseName, getName, getValue, getValues, hashCode, isSameName, toString
public PreEncodedHttpField(HttpHeader header, String name, String value)
public PreEncodedHttpField(HttpHeader header, String value)
public void putTo(ByteBuffer bufferInFillMode, HttpVersion version)
Copyright © 2010 - 2020 Adobe. All Rights Reserved