title: TeeInputStream and PipedStream does not work in any case
body: <p>I run into a problem while "cloning" an InputStream.</p>
  
  <p>This does not work:</p>
  
  <pre><code>InputStream is = ClassLoader.getSystemResourceAsStream("myResource");
  </code></pre>
  
  <p>But this works:</p>
  
  <pre><code>InputStream is = new BufferedInputStream(new FileInputStream("/afas.cfg"));
  </code></pre>
  
  <p>My code is:</p>
  
  <pre><code>// Create a piped input stream for one of the readers.
  PipedInputStream in = new PipedInputStream();
  
  // Create a tee-splitter for the other reader.(from apache commons io)
  TeeInputStream tee = new TeeInputStream(is, new PipedOutputStream(in));
  
  // Create the two buffered readers.
  BufferedReader br1 = new BufferedReader(new InputStreamReader(tee));
  BufferedReader br2 = new BufferedReader(new InputStreamReader(in));
  
  // Do some interleaved reads from them.
  System.out.println("One line from br1:");
  System.out.println(br1.readLine());
  System.out.println();
  
  System.out.println("Two lines from br2:");
  System.out.println(br2.readLine());
  System.out.println(br2.readLine());
  System.out.println();
  
  System.out.println("One line from br1:");
  System.out.println(br1.readLine());
  System.out.println();
  </code></pre>
  
  <p>The problem occurs at the first <code>br1.readLine()</code> call. It just get stuck at <code>PipedInputStream.awaitSpace()</code> and is in an endless loop.</p>
  
  <p>Are the PipedStreams only for threads? Meaning that when writing to the  PipedOutputStreams the PipedInputStream would "wake up"</p>
  
  <p>What do i have to do to get this work in any case?</p>