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

AbstractMessageWriter

public abstract class AbstractMessageWriter extends Object implements HttpMessageWriter

Fields Summary
protected final SessionOutputBuffer
sessionBuffer
protected final CharArrayBuffer
lineBuf
protected final LineFormatter
lineFormatter
Constructors Summary
public AbstractMessageWriter(SessionOutputBuffer buffer, LineFormatter formatter, HttpParams params)

        super();
        if (buffer == null) {
            throw new IllegalArgumentException("Session input buffer may not be null");
        }
        this.sessionBuffer = buffer;
        this.lineBuf = new CharArrayBuffer(128);
        this.lineFormatter = (formatter != null) ?
            formatter : BasicLineFormatter.DEFAULT;
    
Methods Summary
public voidwrite(org.apache.http.HttpMessage message)

        if (message == null) {
            throw new IllegalArgumentException("HTTP message may not be null");
        }
        writeHeadLine(message);
        for (Iterator it = message.headerIterator(); it.hasNext(); ) {
            Header header = (Header) it.next();
            this.sessionBuffer.writeLine
                (lineFormatter.formatHeader(this.lineBuf, header));
        }
        this.lineBuf.clear();
        this.sessionBuffer.writeLine(this.lineBuf);
    
protected abstract voidwriteHeadLine(org.apache.http.HttpMessage message)