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

IdentityOutputStream

public class IdentityOutputStream extends OutputStream
A stream for writing with an "identity" transport encoding.
author
Oleg Kalnichevski
version
$Revision: 560343 $
since
4.0

Fields Summary
private final SessionOutputBuffer
out
Wrapped session output buffer.
private boolean
closed
True if the stream is closed.
Constructors Summary
public IdentityOutputStream(SessionOutputBuffer out)


        
        super();
        if (out == null) {
            throw new IllegalArgumentException("Session output buffer may not be null");
        }
        this.out = out;
    
Methods Summary
public voidclose()

Does not close the underlying socket output.

throws
IOException If an I/O problem occurs.

        if (!this.closed) {
            this.closed = true;
            this.out.flush();
        }
    
public voidflush()

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

        if (this.closed) {
            throw new IOException("Attempted write to closed stream.");
        }
        this.out.write(b, off, len);
    
public voidwrite(byte[] b)

        write(b, 0, b.length);
    
public voidwrite(int b)

        if (this.closed) {
            throw new IOException("Attempted write to closed stream.");
        }
        this.out.write(b);