donaldp 02/04/25 23:36:48
Modified: io/src/java/org/apache/avalon/excalibur/io
DemuxInputStream.java DemuxOutputStream.java
Log:
Make the bind methods return the old stream associated with this thread. This
is to facilitate the ability to restore old stream after a period of time.
Revision Changes Path
1.3 +4 -2
jakarta-avalon-excalibur/io/src/java/org/apache/avalon/excalibur/io/DemuxInputStream.java
Index: DemuxInputStream.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/io/src/java/org/apache/avalon/excalibur/io/DemuxInputStream.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DemuxInputStream.java 11 Apr 2002 08:02:47 -0000 1.2
+++ DemuxInputStream.java 26 Apr 2002 06:36:48 -0000 1.3
@@ -15,7 +15,7 @@
* with this thread.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
- * @version $Revision: 1.2 $ $Date: 2002/04/11 08:02:47 $
+ * @version $Revision: 1.3 $ $Date: 2002/04/26 06:36:48 $
*/
public final class DemuxInputStream
extends InputStream
@@ -27,9 +27,11 @@
*
* @param input the stream to bind
*/
- public void bindStream( final InputStream input )
+ public InputStream bindStream( final InputStream input )
{
+ final InputStream oldValue = getStream();
m_streams.set( input );
+ return oldValue;
}
/**
1.3 +4 -2
jakarta-avalon-excalibur/io/src/java/org/apache/avalon/excalibur/io/DemuxOutputStream.java
Index: DemuxOutputStream.java
===================================================================
RCS file:
/home/cvs/jakarta-avalon-excalibur/io/src/java/org/apache/avalon/excalibur/io/DemuxOutputStream.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DemuxOutputStream.java 11 Apr 2002 08:02:47 -0000 1.2
+++ DemuxOutputStream.java 26 Apr 2002 06:36:48 -0000 1.3
@@ -15,7 +15,7 @@
* with this thread.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
- * @version $Revision: 1.2 $ $Date: 2002/04/11 08:02:47 $
+ * @version $Revision: 1.3 $ $Date: 2002/04/26 06:36:48 $
*/
public final class DemuxOutputStream
extends OutputStream
@@ -27,9 +27,11 @@
*
* @param output the stream to bind
*/
- public void bindStream( final OutputStream output )
+ public OutputStream bindStream( final OutputStream output )
{
+ final OutputStream stream = getStream();
m_streams.set( output );
+ return stream;
}
/**
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>