public class PreEncodedHttpField extends HttpField
A 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| Modifier and Type | Field and Description |
|---|---|
private static HttpFieldPreEncoder[] |
__encoders |
private byte[][] |
_encodedField |
private static Logger |
LOG |
| Constructor and Description |
|---|
PreEncodedHttpField(HttpHeader header,
java.lang.String value) |
PreEncodedHttpField(HttpHeader header,
java.lang.String name,
java.lang.String value) |
PreEncodedHttpField(java.lang.String name,
java.lang.String value) |
| Modifier and Type | Method and Description |
|---|---|
private static int |
index(HttpVersion version) |
void |
putTo(java.nio.ByteBuffer bufferInFillMode,
HttpVersion version) |
contains, equals, getHeader, getIntValue, getLongValue, getName, getValue, getValues, hashCode, isSameName, toStringprivate static final Logger LOG
private static final HttpFieldPreEncoder[] __encoders
private final byte[][] _encodedField
public PreEncodedHttpField(HttpHeader header, java.lang.String name, java.lang.String value)
public PreEncodedHttpField(HttpHeader header, java.lang.String value)
public PreEncodedHttpField(java.lang.String name,
java.lang.String value)
private static int index(HttpVersion version)
public void putTo(java.nio.ByteBuffer bufferInFillMode,
HttpVersion version)