|
Java™ by example!
|
|
|
How do I pass the output of one thread as the input to another (using InputStream/OutputStream)?
A PipedInputStream and PipedOutputStream are used to communicate between threads. If you connect the two together, whatever you write to the PipedOutputStream, you receive on the PipedInputStream. Here's an example: Main.java:
outputs:
Further Information
Author of answer: Joris Van den Bogaert
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|