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

LoggingSessionInputBuffer

public class LoggingSessionInputBuffer extends Object implements SessionInputBuffer
Logs all data read to the wire LOG.
author
Ortwin Glueck
author
Mike Bowler
author
Oleg Kalnichevski
since
4.0

Fields Summary
private final SessionInputBuffer
in
Original session input buffer.
private final Wire
wire
The wire log to use for writing.
Constructors Summary
public LoggingSessionInputBuffer(SessionInputBuffer in, Wire wire)
Create an instance that wraps the specified session input buffer.

param
in The session input buffer.
param
wire The wire log to use.

        super();
        this.in = in;
        this.wire = wire;
    
Methods Summary
public org.apache.http.io.HttpTransportMetricsgetMetrics()

        return this.in.getMetrics();
    
public booleanisDataAvailable(int timeout)

        return this.in.isDataAvailable(timeout);
    
public intread(byte[] b, int off, int len)

        int l = this.in.read(b,  off,  len);
        if (this.wire.enabled() && l > 0) {
            this.wire.input(b, off, l);
        }
        return l;
    
public intread()

        int l = this.in.read();
        if (this.wire.enabled() && l > 0) { 
            this.wire.input(l);
        }
        return l;
    
public intread(byte[] b)

        int l = this.in.read(b);
        if (this.wire.enabled() && l > 0) {
            this.wire.input(b, 0, l);
        }
        return l;
    
public java.lang.StringreadLine()

        String s = this.in.readLine();
        if (this.wire.enabled() && s != null) {
            this.wire.input(s + "[EOL]");
        }
        return s;
    
public intreadLine(org.apache.http.util.CharArrayBuffer buffer)

        int l = this.in.readLine(buffer);
        if (this.wire.enabled() && l > 0) {
            int pos = buffer.length() - l;
            String s = new String(buffer.buffer(), pos, l);
            this.wire.input(s + "[EOL]");
        }
        return l;