Javatpoint Logo
Javatpoint Logo

PipedInputStream and PipedOutputStream classes

The PipedInputStream and PipedOutputStream classes can be used to read and write data simultaneously. Both streams are connected with each other using the connect() method of the PipedOutputStream class.


Example of PipedInputStream and PipedOutputStream classes using threads

Here, we have created two threads t1 and t2. The t1 thread writes the data using the PipedOutputStream object and the t2 thread reads the data from that pipe using the PipedInputStream object. Both the piped stream object are connected with each other.






Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA