Top Description Fields Constructors Methods
org.apache.commons.io.output

public Class ProxyOutputStream

extends FilterOutputStream
Class Inheritance
Known Direct Subclasses
org.apache.commons.io.output.TeeOutputStream, org.apache.commons.io.output.CountingOutputStream
Imports
java.io.IOException, .FilterOutputStream, .OutputStream

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 471628 2006-11-06 04:06:45Z bayard $

Field Summary

Inherited from java.io.FilterOutputStream:
out

Constructor Summary

AccessConstructor and Description
public
ProxyOutputStream(OutputStream
the OutputStream to delegate to
proxy
)

Constructs a new ProxyOutputStream.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides java.io.FilterOutputStream.close.

Implements java.io.Closeable.close.

Closes this output stream and releases any system resources associated with the stream.
public void
flush()

Overrides java.io.FilterOutputStream.flush.

Implements java.io.Flushable.flush.

Flushes this output stream and forces any buffered output bytes to be written out to the stream.
public void
write(int
the byte.
idx
)

Overrides java.io.FilterOutputStream.write.

Writes the specified byte to this output stream.
public void
write(byte[]
the data to be written.
bts
)

Overrides java.io.FilterOutputStream.write.

Writes b.length bytes to this output stream.
public void
write(byte[]
the data.
bts
,
int
the start offset in the data.
st
,
int
the number of bytes to write.
end
)

Overrides java.io.FilterOutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this output stream.

Constructor Detail

ProxyOutputStreamback to summary
public ProxyOutputStream(OutputStream proxy)

Constructs a new ProxyOutputStream.

Parameters
proxy:OutputStream

the OutputStream to delegate to

Method Detail

closeback to summary
public void close() throws IOException

Overrides java.io.FilterOutputStream.close.

Implements java.io.Closeable.close.

Doc from java.io.FilterOutputStream.close.

Closes this output stream and releases any system resources associated with the stream.

Exceptions
IOException:
if an I/O error occurs.
See Also
java.io.OutputStream#close()
flushback to summary
public void flush() throws IOException

Overrides java.io.FilterOutputStream.flush.

Implements java.io.Flushable.flush.

Doc from java.io.FilterOutputStream.flush.

Flushes this output stream and forces any buffered output bytes to be written out to the stream.

Exceptions
IOException:
if an I/O error occurs.
See Also
java.io.OutputStream#flush()
writeback to summary
public void write(int idx) throws IOException

Overrides java.io.FilterOutputStream.write.

Doc from java.io.FilterOutputStream.write.

Writes the specified byte to this output stream.

The write method of FilterOutputStream calls the write method of its underlying output stream, that is, it performs out.write(b).

Implements the abstract write method of OutputStream.

Parameters
idx:int

the byte.

Exceptions
IOException:
if an I/O error occurs.
See Also
java.io.OutputStream#write(int)
writeback to summary
public void write(byte[] bts) throws IOException

Overrides java.io.FilterOutputStream.write.

Doc from java.io.FilterOutputStream.write.

Writes b.length bytes to this output stream.

Parameters
bts:byte[]

the data to be written.

Exceptions
IOException:
if an I/O error occurs.
See Also
java.io.OutputStream#write(byte[])
writeback to summary
public void write(byte[] bts, int st, int end) throws IOException

Overrides java.io.FilterOutputStream.write.

Doc from java.io.FilterOutputStream.write.

Writes len bytes from the specified byte array starting at offset off to this output stream.

Parameters
bts:byte[]

the data.

st:int

the start offset in the data.

end:int

the number of bytes to write.

Exceptions
IOException:
if an I/O error occurs.
See Also
java.io.OutputStream#write(byte[], int, int)