Code example for PipedOutputStream

0
    m_intermediateSender = new StreamSender(intermediateSenderOutputStream); 
 
    final InputStream receiverInputStream = 
      new BigBufferPipedInputStream(intermediateSenderOutputStream); 
 
    final PipedOutputStream senderOutputStream = new PipedOutputStream(); 
 
    initialise(new StreamReceiver(receiverInputStream), 
               new StreamSender(senderOutputStream)); 
 
    final InputStream intermediateReceiverInputStream = 
      new BigBufferPipedInputStream(senderOutputStream); 
    m_intermediateReceiver = 
      new StreamReceiver(intermediateReceiverInputStream); 
 
    m_messagePump = 
      new MessagePump(m_intermediateReceiver, m_intermediateSender, 1); 
 
    m_messagePump.start(); 
  }