org.apache.commons.io.output

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

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

Author: Stephen Colebourne

Constructor Summary
ProxyOutputStream(OutputStream proxy)
Constructs a new ProxyOutputStream.
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(byte[] bts)
Invokes the delegate's write(byte[]) method.
voidwrite(byte[] bts, int st, int end)
Invokes the delegate's write(byte[]) method.

Constructor Detail

ProxyOutputStream

public ProxyOutputStream(OutputStream proxy)
Constructs a new ProxyOutputStream.

Parameters: proxy the OutputStream 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 byte to write

Throws: IOException if an I/O error occurs

write

public void write(byte[] bts)
Invokes the delegate's write(byte[]) method.

Parameters: bts the bytes to write

Throws: IOException if an I/O error occurs

write

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

Parameters: bts the bytes to write st The start offset end The number of bytes to write

Throws: IOException if an I/O error occurs

Copyright (c) 2002-2011 Apache Software Foundation