| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Objectorg.apache.commons.httpclient.HttpParserpublic class HttpParserextends java.lang.ObjectMethod Summary | |
static Header[] |
|
static Header[] |
|
static String |
|
static String |
|
static byte[] |
|
public static Header[] parseHeaders(InputStream is) throws IOException, HttpException
Deprecated. use #parseHeaders(InputStream, String)
Parses headers from the given stream. Headers with the same name are not combined.
- Parameters:
is- the stream to read headers from
- Returns:
- an array of headers in the order in which they were parsed
- Throws:
HttpException- if there is an error parsing a header value
public static Header[] parseHeaders(InputStream is, String charset) throws IOException, HttpException
Parses headers from the given stream. Headers with the same name are not combined.
- Parameters:
is- the stream to read headers fromcharset- the charset to use for reading the data
- Returns:
- an array of headers in the order in which they were parsed
- Throws:
HttpException- if there is an error parsing a header value
- Since:
- 3.0
public static String readLine(InputStream inputStream)
throws IOExceptionDeprecated. use #readLine(InputStream, String)
Read up to "\n" from an (unchunked) input stream. If the stream ends before the line terminator is found, the last part of the string will still be returned. If no input data available,nullis returned
- Parameters:
inputStream- the stream to read from
- Returns:
- a line from the stream
public static String readLine(InputStream inputStream,
String charset)
throws IOExceptionRead up to "\n" from an (unchunked) input stream. If the stream ends before the line terminator is found, the last part of the string will still be returned. If no input data available,nullis returned.
- Parameters:
inputStream- the stream to read fromcharset- charset of HTTP protocol elements
- Returns:
- a line from the stream
- Since:
- 3.0
public static byte[] readRawLine(InputStream inputStream)
throws IOExceptionReturn byte array from an (unchunked) input stream. Stop reading when "\n" terminator encountered If the stream ends before the line terminator is found, the last part of the string will still be returned. If no input data available,nullis returned.
- Parameters:
inputStream- the stream to read from
- Returns:
- a byte array from the stream