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

IdentityInputStream

public class IdentityInputStream extends InputStream
A stream for reading from a {@link SessionInputBuffer session input buffer}.
author
Oleg Kalnichevski
version
$Revision: 560358 $
since
4.0

Fields Summary
private final SessionInputBuffer
in
private boolean
closed
Constructors Summary
public IdentityInputStream(SessionInputBuffer in)

    
        
        super();
        if (in == null) {
            throw new IllegalArgumentException("Session input buffer may not be null");
        }
        this.in = in;
    
Methods Summary
public intavailable()

        if (!this.closed && this.in.isDataAvailable(10)) {
            return 1;
        } else {
            return 0;
        }
    
public voidclose()

        this.closed = true;
    
public intread()

        if (this.closed) {
            return -1;
        } else {
            return this.in.read();
        }
    
public intread(byte[] b, int off, int len)

        if (this.closed) {
            return -1;
        } else {
            return this.in.read(b, off, len);
        }