FileDocCategorySizeDatePackage
LoggingSessionOutputBuffer.javaAPI DocAndroid 1.5 API3525Wed May 06 22:41:10 BST 2009org.apache.http.impl.conn

LoggingSessionOutputBuffer

public class LoggingSessionOutputBuffer extends Object implements SessionOutputBuffer
Logs all data written to the wire LOG.
author
Oleg Kalnichevski
since
4.0

Fields Summary
private final SessionOutputBuffer
out
Original data transmitter.
private final Wire
wire
The wire log to use.
Constructors Summary
public LoggingSessionOutputBuffer(SessionOutputBuffer out, Wire wire)
Create an instance that wraps the specified session output buffer.

param
out The session output buffer.
param
wire The Wire log to use.

        super();
        this.out = out;
        this.wire = wire;
    
Methods Summary
public voidflush()

        this.out.flush();
    
public org.apache.http.io.HttpTransportMetricsgetMetrics()

        return this.out.getMetrics();
    
public voidwrite(byte[] b, int off, int len)

        this.out.write(b,  off,  len);
        if (this.wire.enabled()) {
            this.wire.output(b, off, len);
        }
    
public voidwrite(int b)

        this.out.write(b);
        if (this.wire.enabled()) {
            this.wire.output(b);
        }
    
public voidwrite(byte[] b)

        this.out.write(b);
        if (this.wire.enabled()) {
            this.wire.output(b);
        }
    
public voidwriteLine(org.apache.http.util.CharArrayBuffer buffer)

        this.out.writeLine(buffer);
        if (this.wire.enabled()) {
            String s = new String(buffer.buffer(), 0, buffer.length());
            this.wire.output(s + "[EOL]");
        }
    
public voidwriteLine(java.lang.String s)

        this.out.writeLine(s);
        if (this.wire.enabled()) {
            this.wire.output(s + "[EOL]");
        }