All About Class PipedOutputStream in Java


A PipedOutputStream is the transmitting end of a communication channel through pipe. Two threads can communicate by having one thread send the data through PipedInputStream and other thread read data through a PipedInputStream.
The class PipedInputStream is given as:

public class java.io.PipedOutputStream extends java.io.OutputStream{
//constructors
public PipedOutputStream();
//creates a PipedInputStream which is not yet connected to a PipedInputStream. It needs to be 
//connected to a PipedInputStream either by the receiver or the sender before being used.
public PipedOutputStream(PipedInputStream stm);
//creates a PipedInputStream which is connected to a PipedOutputStream stm.
//methods
public void close();
public void connect(PipedInputStream stm);
public void write(int b);
public void write(byte b[],int offSet,int length);
}
 
In addition, all methods may throw an IOException if an IO error occurs apart from their regular Exceptions.
All About Class PipedOutputStream in Java All About Class PipedOutputStream in Java Reviewed by Animesh Chatterjee on October 10, 2018 Rating: 5

No comments:

Powered by Blogger.