org.apache.commons.io.output
Class ProxyOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by org.apache.commons.io.output.ProxyOutputStream
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable
Direct Known Subclasses:
CloseShieldOutputStream, CountingOutputStream, TeeOutputStream

public class ProxyOutputStream
extends java.io.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

Field Summary
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
ProxyOutputStream(java.io.OutputStream proxy)
          Constructs a new ProxyOutputStream.
 
Method Summary
 void close()
          Invokes the delegate's close() method.
 void flush()
          Invokes the delegate's flush() method.
 void write(byte[] bts)
          Invokes the delegate's write(byte[]) method.
 void write(byte[] bts, int st, int end)
          Invokes the delegate's write(byte[]) method.
 void write(int idx)
          Invokes the delegate's write(int) method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyOutputStream

public ProxyOutputStream(java.io.OutputStream proxy)
Constructs a new ProxyOutputStream.

Parameters:
proxy - the OutputStream to delegate to
Method Detail

write

public void write(int idx)
           throws java.io.IOException
Invokes the delegate's write(int) method.

Overrides:
write in class java.io.FilterOutputStream
Parameters:
idx - the byte to write
Throws:
java.io.IOException - if an I/O error occurs

write

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

Overrides:
write in class java.io.FilterOutputStream
Parameters:
bts - the bytes to write
Throws:
java.io.IOException - if an I/O error occurs

write

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

Overrides:
write in class java.io.FilterOutputStream
Parameters:
bts - the bytes to write
st - The start offset
end - The number of bytes to write
Throws:
java.io.IOException - if an I/O error occurs

flush

public void flush()
           throws java.io.IOException
Invokes the delegate's flush() method.

Specified by:
flush in interface java.io.Flushable
Overrides:
flush in class java.io.FilterOutputStream
Throws:
java.io.IOException - if an I/O error occurs

close

public void close()
           throws java.io.IOException
Invokes the delegate's close() method.

Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.FilterOutputStream
Throws:
java.io.IOException - if an I/O error occurs


Copyright (c) 2002-2013 Apache Software Foundation