Code example for PipedInputStream

0
	private PipedInputStream pi ; 
	private PipedOutputStream po;
	 
	WebSocketInputStream() throws IOException { 
		po = new PipedOutputStream();
		pi = new PipedInputStream(po);
	} 
	 
	@Override 
	public int read() throws IOException { 
		 
		return pi.read();
		 
	} 
	 
	@Override 
	public int read(byte[] b) throws IOException {
		return pi.read(b);
	} 
 
	@Override