Code example for PushbackReader

Methods: read, unread

0
     */ 
    public void test_ConstructorLjava_io_Reader() { 
        // Test for method java.io.PushbackReader(java.io.Reader) 
        try { 
            pbr.close();
            pbr = new PushbackReader(new StringReader(pbString));
            char buf[] = new char[5];
            pbr.read(buf, 0, 5);
            pbr.unread(buf);
            fail("Created reader with buffer larger than 1");;
        } catch (IOException e) {
            // Expected 
        } 
 
        try { 
            pbr = new PushbackReader(null);
        } catch (NullPointerException e) {
            // EXpected 
        } 
    }