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

public Class DemuxOutputStream

extends OutputStream
Class Inheritance
Imports
java.io.IOException, .OutputStream

Data written to this stream is forwarded to a stream that has been associated with this thread.
Author
Peter Donald
Version
$Revision: 437567 $ $Date: 2006-08-28 08:39:07 +0200 (Mo, 28 Aug 2006) $

Field Summary

Modifier and TypeField and Description
private InheritableThreadLocal<T>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public OutputStream

Returns:

the OutputStream that was previously active
bindStream
(OutputStream
the stream to bind
output
)

Bind the specified stream to the current thread.

public void
close()

Overrides java.io.OutputStream.close.

Implements java.io.Closeable.close.

Closes stream associated with current thread.
public void
flush()

Overrides java.io.OutputStream.flush.

Implements java.io.Flushable.flush.

Flushes stream associated with current thread.
private OutputStream

Returns:

the output stream
getStream
()

Utility method to retrieve stream bound to current thread (if any).

public void
write(int
the byte to write to stream
ch
)

Implements abstract java.io.OutputStream.write.

Writes byte to stream associated with current thread.
Inherited from java.io.OutputStream:
nullOutputStreamwritewrite

Field Detail

m_streamsback to summary
private InheritableThreadLocal<T> m_streams

Constructor Detail

DemuxOutputStreamback to summary
public DemuxOutputStream()

Method Detail

bindStreamback to summary
public OutputStream bindStream(OutputStream output)

Bind the specified stream to the current thread.

Parameters
output:OutputStream

the stream to bind

Returns:OutputStream

the OutputStream that was previously active

closeback to summary
public void close() throws IOException

Overrides java.io.OutputStream.close.

Implements java.io.Closeable.close.

Closes stream associated with current thread.

Exceptions
IOException:
if an error occurs
flushback to summary
public void flush() throws IOException

Overrides java.io.OutputStream.flush.

Implements java.io.Flushable.flush.

Flushes stream associated with current thread.

Exceptions
IOException:
if an error occurs
getStreamback to summary
private OutputStream getStream()

Utility method to retrieve stream bound to current thread (if any).

Returns:OutputStream

the output stream

writeback to summary
public void write(int ch) throws IOException

Implements abstract java.io.OutputStream.write.

Writes byte to stream associated with current thread.

Parameters
ch:int

the byte to write to stream

Exceptions
IOException:
if an error occurs