Package org.eclipse.jetty.http
Class PreEncodedHttpField
- java.lang.Object
-
- org.eclipse.jetty.http.HttpField
-
- org.eclipse.jetty.http.PreEncodedHttpField
-
public class PreEncodedHttpField extends HttpField
Pre encoded HttpField.An HttpField that will be cached and used many times can be created as a
PreEncodedHttpField
, which will use theHttpFieldPreEncoder
instances discovered by theServiceLoader
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 Modifier and Type Field Description private static HttpFieldPreEncoder[]
__encoders
private byte[][]
_encodedField
private static Logger
LOG
-
Constructor Summary
Constructors Constructor Description PreEncodedHttpField(java.lang.String name, java.lang.String value)
PreEncodedHttpField(HttpHeader header, java.lang.String value)
PreEncodedHttpField(HttpHeader header, java.lang.String name, java.lang.String value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static int
index(HttpVersion version)
void
putTo(java.nio.ByteBuffer bufferInFillMode, HttpVersion version)
-
Methods inherited from class org.eclipse.jetty.http.HttpField
contains, equals, getHeader, getIntValue, getLongValue, getLowerCaseName, getName, getValue, getValues, hashCode, is, isSameName, toString
-
-
-
-
Field Detail
-
LOG
private static final Logger LOG
-
__encoders
private static final HttpFieldPreEncoder[] __encoders
-
_encodedField
private final byte[][] _encodedField
-
-
Constructor Detail
-
PreEncodedHttpField
public PreEncodedHttpField(HttpHeader header, java.lang.String name, java.lang.String value)
-
PreEncodedHttpField
public PreEncodedHttpField(HttpHeader header, java.lang.String value)
-
PreEncodedHttpField
public PreEncodedHttpField(java.lang.String name, java.lang.String value)
-
-
Method Detail
-
index
private static int index(HttpVersion version)
-
putTo
public void putTo(java.nio.ByteBuffer bufferInFillMode, HttpVersion version)
-
-