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

public Class DemuxInputStream

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

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 InputStream

Returns:

the InputStream that was previously active
bindStream
(InputStream
the stream to bind
input
)

Bind the specified stream to the current thread.

public void
close()

Overrides java.io.InputStream.close.

Implements java.io.Closeable.close.

Closes stream associated with current thread.
private InputStream

Returns:

the input stream
getStream
()

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

public int

Returns:

the byte read from stream
read
()

Implements abstract java.io.InputStream.read.

Read byte from stream associated with current thread.
Inherited from java.io.InputStream:
availablemarkmarkSupportednullInputStreamreadreadreadAllBytesreadNBytesreadNBytesresetskipskipNBytestransferTo

Field Detail

m_streamsback to summary
private InheritableThreadLocal<T> m_streams

Constructor Detail

DemuxInputStreamback to summary
public DemuxInputStream()

Method Detail

bindStreamback to summary
public InputStream bindStream(InputStream input)

Bind the specified stream to the current thread.

Parameters
input:InputStream

the stream to bind

Returns:InputStream

the InputStream that was previously active

closeback to summary
public void close() throws IOException

Overrides java.io.InputStream.close.

Implements java.io.Closeable.close.

Closes stream associated with current thread.

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

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

Returns:InputStream

the input stream

readback to summary
public int read() throws IOException

Implements abstract java.io.InputStream.read.

Read byte from stream associated with current thread.

Returns:int

the byte read from stream

Exceptions
IOException:
if an error occurs