Mercurial Hosting > luan
diff src/org/eclipse/jetty/http/HttpHeaderValues.java @ 1020:6be43ef1eb96
HttpHeaderValues uses StringCache
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 31 Oct 2016 22:24:41 -0600 |
parents | 74b9daf2826c |
children | 3718afd99988 |
line wrap: on
line diff
--- a/src/org/eclipse/jetty/http/HttpHeaderValues.java Mon Oct 31 03:33:42 2016 -0600 +++ b/src/org/eclipse/jetty/http/HttpHeaderValues.java Mon Oct 31 22:24:41 2016 -0600 @@ -18,19 +18,16 @@ package org.eclipse.jetty.http; -import org.eclipse.jetty.io.Buffer; -import org.eclipse.jetty.io.BufferCache; -import org.eclipse.jetty.io.ByteArrayBuffer; +import org.eclipse.jetty.io.StringCache; /** * Cached HTTP Header values. - * This class caches the conversion of common HTTP Header values to and from {@link ByteArrayBuffer} instances. * The resource "/org/eclipse/jetty/useragents" is checked for a list of common user agents, so that repeated * creation of strings for these agents can be avoided. * * */ -public class HttpHeaderValues extends BufferCache +public final class HttpHeaderValues { public final static String CLOSE="close", @@ -58,20 +55,20 @@ NO_CACHE_ORDINAL=10, UPGRADE_ORDINAL=11; - public final static HttpHeaderValues CACHE = new HttpHeaderValues(); + public final static StringCache CACHE = new StringCache(); - public final static Buffer - CLOSE_BUFFER=CACHE.add(CLOSE,CLOSE_ORDINAL), - CHUNKED_BUFFER=CACHE.add(CHUNKED,CHUNKED_ORDINAL), - GZIP_BUFFER=CACHE.add(GZIP,GZIP_ORDINAL), - IDENTITY_BUFFER=CACHE.add(IDENTITY,IDENTITY_ORDINAL), - KEEP_ALIVE_BUFFER=CACHE.add(KEEP_ALIVE,KEEP_ALIVE_ORDINAL), - CONTINUE_BUFFER=CACHE.add(CONTINUE, CONTINUE_ORDINAL), - PROCESSING_BUFFER=CACHE.add(PROCESSING, PROCESSING_ORDINAL), - TE_BUFFER=CACHE.add(TE,TE_ORDINAL), - BYTES_BUFFER=CACHE.add(BYTES,BYTES_ORDINAL), - NO_CACHE_BUFFER=CACHE.add(NO_CACHE,NO_CACHE_ORDINAL), - UPGRADE_BUFFER=CACHE.add(UPGRADE,UPGRADE_ORDINAL); + public final static byte[] + CLOSE_BYTES=CACHE.add(CLOSE,CLOSE_ORDINAL), + CHUNKED_BYTES=CACHE.add(CHUNKED,CHUNKED_ORDINAL), + GZIP_BYTES=CACHE.add(GZIP,GZIP_ORDINAL), + IDENTITY_BYTES=CACHE.add(IDENTITY,IDENTITY_ORDINAL), + KEEP_ALIVE_BYTES=CACHE.add(KEEP_ALIVE,KEEP_ALIVE_ORDINAL), + CONTINUE_BYTES=CACHE.add(CONTINUE, CONTINUE_ORDINAL), + PROCESSING_BYTES=CACHE.add(PROCESSING, PROCESSING_ORDINAL), + TE_BYTES=CACHE.add(TE,TE_ORDINAL), + BYTES_BYTES=CACHE.add(BYTES,BYTES_ORDINAL), + NO_CACHE_BYTES=CACHE.add(NO_CACHE,NO_CACHE_ORDINAL), + UPGRADE_BYTES=CACHE.add(UPGRADE,UPGRADE_ORDINAL); public static boolean hasKnownValues(int httpHeaderOrdinal)