Code example for PipedReader

Methods: close, read

0
            pw = null;
            pr = null;
        } 
 
        pw = new PipedWriter();
        pr = new PipedReader(pw);
        pr.close();
        try { 
            pr.read(new char[0], -1, -1);
            fail("should throw IOException");
        } catch (IOException e) {
            // expected 
        } finally { 
            pw = null;
            pr = null;
        } 
 
        pw = new PipedWriter();
        pr = new PipedReader(pw);
        pr.close();
        try {