Code example for PipedReader

Methods: close, read

0
    /** 
     * @tests java.io.PipedReader#read(char[], int, int) 
     */ 
    public void test_read_$CII_IOException() throws IOException { 
        PipedWriter pw = new PipedWriter();
        PipedReader pr = new PipedReader(pw);
        char[] buf = null;
        pr.close();
        try { 
            pr.read(buf, 0, 10);
            fail("Should throws IOException");
        } catch (IOException e) {
            // expected 
        } finally { 
            pw = null;
            pr = null;
        } 
 
        pr = new PipedReader();
        buf = null;
        pr.close();