Code example for PipedReader

0
 
    /** 
     * @tests java.io.PipedReader#PipedReader(java.io.PipedWriter) 
     */ 
    public void test_ConstructorLjava_io_PipedWriter() throws IOException { 
        preader = new PipedReader(new PipedWriter());
    } 
 
    /** 
     * @tests java.io.PipedReader#PipedReader(java.io.PipedWriter, 
     *        int) 
     * @since 1.6 
     */ 
    public void test_Constructor_LPipedWriter_I() throws Exception { 
        // Test for method java.io.PipedReader(java.io.PipedWriter, 
        // int) 
        try { 
            preader = new PipedReader(null, -1);
            fail("Should throw IllegalArgumentException");
        } catch (IllegalArgumentException e) {
            // expected