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

ProxyWriter

public class ProxyWriter extends FilterWriter
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 FilterWriter to increase reusability, because FilterWriter changes the methods being called, such as write(char[]) to write(char[], int, int) and write(String) to write(String, int, int).
author
Stephen Colebourne
version
$Id: ProxyWriter.java 610010 2008-01-08 14:50:59Z niallp $

Fields Summary
Constructors Summary
public ProxyWriter(Writer proxy)
Constructs a new ProxyWriter.

param
proxy the Writer 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 character to write
throws
IOException if an I/O error occurs

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

param
chr the characters to write
throws
IOException if an I/O error occurs

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

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

        out.write(chr, st, end);
    
public voidwrite(java.lang.String str)
Invokes the delegate's write(String) method.

param
str the string to write
throws
IOException if an I/O error occurs

        out.write(str);
    
public voidwrite(java.lang.String str, int st, int end)
Invokes the delegate's write(String) method.

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

        out.write(str, st, end);