Class PreEncodedHttpField


  • public class PreEncodedHttpField
    extends HttpField
    Pre encoded 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.