PipedInputStream and PipedOutputStream classesThe 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 threadsHere, 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.
Next TopicSerialization in Java
|