FileDocCategorySizeDatePackage
ProxyOutputStream.javaAPI DocAndroid 1.5 API2987Wed May 06 22:42:46 BST 2009org.apache.commons.io.output

ProxyOutputStream

public class ProxyOutputStream extends FilterOutputStream
A Proxy stream which acts as expected, that is it passes the method calls on to the proxied stream and doesn't change which methods are being called. It is an alternative base class to FilterOutputStream to increase reusability.
author
Stephen Colebourne
version
$Id: ProxyOutputStream.java 610010 2008-01-08 14:50:59Z niallp $

Fields Summary
Constructors Summary
public ProxyOutputStream(OutputStream proxy)
Constructs a new ProxyOutputStream.

param
proxy the OutputStream to delegate to

        super(proxy);
        // the proxy is stored in a protected superclass variable named 'out'
    
Methods Summary
public voidclose()
Invokes the delegate's close() method.

throws
IOException if an I/O error occurs

        out.close();
    
public voidflush()
Invokes the delegate's flush() method.

throws
IOException if an I/O error occurs

        out.flush();
    
public voidwrite(int idx)
Invokes the delegate's write(int) method.

param
idx the byte to write
throws
IOException if an I/O error occurs

        out.write(idx);
    
public voidwrite(byte[] bts)
Invokes the delegate's write(byte[]) method.

param
bts the bytes to write
throws
IOException if an I/O error occurs

        out.write(bts);
    
public voidwrite(byte[] bts, int st, int end)
Invokes the delegate's write(byte[]) method.

param
bts the bytes to write
param
st The start offset
param
end The number of bytes to write
throws
IOException if an I/O error occurs

        out.write(bts, st, end);