public enum HttpVersion extends Enum<HttpVersion>
Enum Constant and Description |
---|
HTTP_0_9 |
HTTP_1_0 |
HTTP_1_1 |
HTTP_2_0 |
Modifier and Type | Field and Description |
---|---|
static Trie<HttpVersion> |
CACHE |
Modifier and Type | Method and Description |
---|---|
String |
asString() |
static HttpVersion |
fromString(String version)
Case insensitive fromString() conversion
|
static HttpVersion |
fromVersion(int version) |
int |
getVersion() |
boolean |
is(String s) |
static HttpVersion |
lookAheadGet(byte[] bytes,
int position,
int limit)
Optimised lookup to find a Http Version and whitespace in a byte array.
|
static HttpVersion |
lookAheadGet(ByteBuffer buffer)
Optimised lookup to find a HTTP Version and trailing white space in a byte array.
|
ByteBuffer |
toBuffer() |
byte[] |
toBytes() |
String |
toString() |
static HttpVersion |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static HttpVersion[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final HttpVersion HTTP_0_9
public static final HttpVersion HTTP_1_0
public static final HttpVersion HTTP_1_1
public static final HttpVersion HTTP_2_0
public static final Trie<HttpVersion> CACHE
public static HttpVersion[] values()
for (HttpVersion c : HttpVersion.values()) System.out.println(c);
public static HttpVersion valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static HttpVersion lookAheadGet(byte[] bytes, int position, int limit)
bytes
- Array containing ISO-8859-1 charactersposition
- The first valid indexlimit
- The first non valid indexpublic static HttpVersion lookAheadGet(ByteBuffer buffer)
buffer
- buffer containing ISO-8859-1 characterspublic byte[] toBytes()
public ByteBuffer toBuffer()
public int getVersion()
public boolean is(String s)
public String asString()
public String toString()
toString
in class Enum<HttpVersion>
public static HttpVersion fromString(String version)
version
- the String to convert to enum constantpublic static HttpVersion fromVersion(int version)
Copyright © 1995-2015 Webtide. All Rights Reserved.