Class Method
java.lang.Object
org.apache.tomcat.util.http.Method
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
bytesToString
(byte[] buf, int start, int len) Provides optimised conversion from bytes to Strings for known HTTP methods.
-
Field Details
-
GET
- See Also:
-
POST
- See Also:
-
PUT
- See Also:
-
PATCH
- See Also:
-
HEAD
- See Also:
-
OPTIONS
- See Also:
-
DELETE
- See Also:
-
TRACE
- See Also:
-
PROPFIND
- See Also:
-
PROPPATCH
- See Also:
-
MKCOL
- See Also:
-
COPY
- See Also:
-
MOVE
- See Also:
-
LOCK
- See Also:
-
UNLOCK
- See Also:
-
CONNECT
- See Also:
-
-
Method Details
-
bytesToString
Provides optimised conversion from bytes to Strings for known HTTP methods. The bytes are assumed to be an ISO-8859-1 encoded representation of an HTTP method. The method is not validated as being a token, but only valid HTTP method names will be returned.Doing it this way is ~10x faster than using MessageBytes.toStringType() saving ~40ns per request which is ~1% of the processing time for a minimal "Hello World" type servlet. For non-standard methods there is an additional overhead of ~2.5ns per request.
Pretty much every request ends up converting the method to a String so it is more efficient to do this straight away and always use Strings.
- Parameters:
buf
- The byte buffer containing the HTTP method to convertstart
- The first byte of the HTTP methodlen
- The number of bytes to convert- Returns:
- The HTTP method as a String or
null
if the method is not recognised.
-