org.apache.commons.io.output

Class 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).

Version: $Id: ProxyWriter.java 610010 2008-01-08 14:50:59Z niallp $

Author: Stephen Colebourne

Constructor Summary
ProxyWriter(Writer proxy)
Constructs a new ProxyWriter.
Method Summary
voidclose()
Invokes the delegate's close() method.
voidflush()
Invokes the delegate's flush() method.
voidwrite(int idx)
Invokes the delegate's write(int) method.
voidwrite(char[] chr)
Invokes the delegate's write(char[]) method.
voidwrite(char[] chr, int st, int end)
Invokes the delegate's write(char[], int, int) method.
voidwrite(String str)
Invokes the delegate's write(String) method.
voidwrite(String str, int st, int end)
Invokes the delegate's write(String) method.

Constructor Detail

ProxyWriter

public ProxyWriter(Writer proxy)
Constructs a new ProxyWriter.

Parameters: proxy the Writer to delegate to

Method Detail

close

public void close()
Invokes the delegate's close() method.

Throws: IOException if an I/O error occurs

flush

public void flush()
Invokes the delegate's flush() method.

Throws: IOException if an I/O error occurs

write

public void write(int idx)
Invokes the delegate's write(int) method.

Parameters: idx the character to write

Throws: IOException if an I/O error occurs

write

public void write(char[] chr)
Invokes the delegate's write(char[]) method.

Parameters: chr the characters to write

Throws: IOException if an I/O error occurs

write

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

Parameters: chr the characters to write st The start offset end The number of characters to write

Throws: IOException if an I/O error occurs

write

public void write(String str)
Invokes the delegate's write(String) method.

Parameters: str the string to write

Throws: IOException if an I/O error occurs

write

public void write(String str, int st, int end)
Invokes the delegate's write(String) method.

Parameters: str the string to write st The start offset end The number of characters to write

Throws: IOException if an I/O error occurs

Copyright (c) 2002-2011 Apache Software Foundation