FileDocCategorySizeDatePackage
HttpRequestParser.javaAPI DocAndroid 1.5 API3177Wed May 06 22:41:10 BST 2009org.apache.http.impl.io

HttpRequestParser

public class HttpRequestParser extends AbstractMessageParser

Fields Summary
private final HttpRequestFactory
requestFactory
private final CharArrayBuffer
lineBuf
Constructors Summary
public HttpRequestParser(SessionInputBuffer buffer, LineParser parser, HttpRequestFactory requestFactory, HttpParams params)

        super(buffer, parser, params);
        if (requestFactory == null) {
            throw new IllegalArgumentException("Request factory may not be null");
        }
        this.requestFactory = requestFactory;
        this.lineBuf = new CharArrayBuffer(128);
    
Methods Summary
protected org.apache.http.HttpMessageparseHead(org.apache.http.io.SessionInputBuffer sessionBuffer)


        this.lineBuf.clear();
        int i = sessionBuffer.readLine(this.lineBuf);
        if (i == -1) {
            throw new ConnectionClosedException("Client closed connection"); 
        }
        ParserCursor cursor = new ParserCursor(0, this.lineBuf.length());
        RequestLine requestline = this.lineParser.parseRequestLine(this.lineBuf, cursor);
        return this.requestFactory.newHttpRequest(requestline);