#vulnerable code 
                                public void test() throws IOException {

        File file = createTestFile();
        InputStream is = new BufferedInputStream(new FileInputStream(file));
        RereadableInputStream ris = new RereadableInputStream(is,
                MEMORY_THRESHOLD);
        try {
            for (int pass = 0; pass < NUM_PASSES; pass++) {
                for (int byteNum = 0; byteNum < TEST_SIZE; byteNum++) {
                    int byteRead = ris.read();
                    assertEquals("Pass = " + pass + ", byte num should be "
                            + byteNum + " but is " + byteRead + ".", byteNum,
                            byteRead);
                }
                ris.rewind();
            }
        } finally {
            is.close();
            ris.close();
        }
    } 
                            #location 15 
                            #vulnerability type RESOURCE_LEAK
#fixed code
                                public void test() throws IOException {

        InputStream is = createTestInputStream();
        RereadableInputStream ris = new RereadableInputStream(is,
                MEMORY_THRESHOLD);
        try {
            for (int pass = 0; pass < NUM_PASSES; pass++) {
                for (int byteNum = 0; byteNum < TEST_SIZE; byteNum++) {
                    int byteRead = ris.read();
                    assertEquals("Pass = " + pass + ", byte num should be "
                            + byteNum + " but is " + byteRead + ".", byteNum,
                            byteRead);
                }
                ris.rewind();
            }
        } finally {
            // The RereadableInputStream should close the original input
            // stream (if it hasn't already).
            ris.close();
        }
    }