Code example for PipedInputStream

0
    return closed.isTrue();
  } 
 
  public static class OutputStreamSender extends MockResponseSender { 
    public OutputStreamSender(OutputStream out) {
      socket = new MockSocket(new PipedInputStream(), out);
    } 
 
    public void doSending(Response response) throws Exception {
      response.readyToSend(this);
      while (!closed.isTrue())
        Thread.sleep(1000);
    } 
  } 
}