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

HttpResponseParser

public class HttpResponseParser extends AbstractMessageParser

Fields Summary
private final HttpResponseFactory
responseFactory
private final CharArrayBuffer
lineBuf
Constructors Summary
public HttpResponseParser(SessionInputBuffer buffer, LineParser parser, HttpResponseFactory responseFactory, HttpParams params)

        super(buffer, parser, params);
        if (responseFactory == null) {
            throw new IllegalArgumentException("Response factory may not be null");
        }
        this.responseFactory = responseFactory;
        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 NoHttpResponseException("The target server failed to respond");
        }
        //create the status line from the status string
        ParserCursor cursor = new ParserCursor(0, this.lineBuf.length());
        StatusLine statusline = lineParser.parseStatusLine(this.lineBuf, cursor);
        return this.responseFactory.newHttpResponse(statusline, null);