public class HTTPHeader extends Object
| Constructor and Description |
|---|
HTTPHeader(String lineStr)Creates a new HTTPHeader by parsing a header line string. |
HTTPHeader(String name,
String value)Creates a new HTTPHeader with the specified name and value. |
| Modifier and Type | Method and Description |
|---|---|
static int | getIntegerValue(byte[] data,
String name)Extracts the integer value of a header with the specified name from a byte array. |
static int | getIntegerValue(String data,
String name)Extracts the integer value of a header with the specified name from a string. |
String | getName()Gets the header name. |
String | getValue()Gets the header value. |
static String | getValue(byte[] data,
String name)Extracts the value of a header with the specified name from a byte array. |
static String | getValue(LineNumberReader reader,
String name)Reads from a LineNumberReader to find the value of a header with the specified name. |
static String | getValue(String data,
String name)Extracts the value of a header with the specified name from a string. |
boolean | hasName()Checks if this header has a valid name. |
void | setName(String name)Sets the header name. |
void | setValue(String value)Sets the header value. |
public HTTPHeader(String lineStr)
lineStr - the header line to parsepublic static final int getIntegerValue(byte[] data,
String name)data - the byte array containing HTTP headersname - the name of the header to findpublic static final int getIntegerValue(String data, String name)
data - the string containing HTTP headersname - the name of the header to findpublic String getName()
public String getValue()
public static final String getValue(byte[] data, String name)
data - the byte array containing HTTP headersname - the name of the header to findpublic static final String getValue(LineNumberReader reader, String name)
reader - the LineNumberReader to read fromname - the name of the header to findpublic static final String getValue(String data, String name)
data - the string containing HTTP headersname - the name of the header to findpublic boolean hasName()
public void setName(String name)
name - the header name to setpublic void setValue(String value)
value - the header value to set