Code example for PipedInputStream

     * This bug claims that InputStreamReader blocks unnecessarily: 
    public void testReadDoesNotBlockUnnecessarily() throws IOException { 
        PipedInputStream pin = new PipedInputStream();
        PipedOutputStream pos = new PipedOutputStream(pin);
        InputStreamReader reader = new InputStreamReader(pin);
        char[] buffer = new char[1024];
        int count =;
        assertEquals(5, count);
Stop searching for code, let great code find you!  Add Codota to your java IDE