title: PipedInputStream not reading from PipedOutputStream
body: <p>So I'm trying to move an operation that involved writing and reading to and from the disk into just writing to a piped stream. Here's the old system, which operated on two threads:</p>
  
  <p>Writing:</p>
  
  <p><code>AudioSystem.write(audioInputStream, AudioFileFormat.Type.WAVE, new File(name));</code></p>
  
  <p>Reading:</p>
  
  <p><code>Wave wave = new Wave(new File(name));</code></p>
  
  <p>And here's the new system:</p>
  
  <p>Writing:</p>
  
  <pre><code>PipedInputStream pipedInputStream = new PipedInputStream();
  PipedOutputStream pipedOutputStream = new PipedOutputStream();
  pipedOutputStream.connect(pipedInputStream);
  
  AudioSystem.write(audioInputStream, AudioFileFormat.Type.WAVE, pipedOutputStream);
  ReadingThread.queue.add(pipedInputStream);
  </code></pre>
  
  <p>Reading:</p>
  
  <pre><code>Wave wave = new Wave(new BufferedInputStream(queue.poll());
  </code></pre>
  
  <p>The old system works properly, and data gets through, but in the new system data does not get to the other end. Wave can be initialised by a file or input stream.</p>