Code example for OutputStreamWriter

Methods: close, write

0
            } 
        }  
    } 
 
    private void saveString(File actualFile, String actualContents) throws IOException {
        Writer w = new OutputStreamWriter(new FileOutputStream(actualFile), "UTF-8");
        try { 
            w.write(actualContents);
        } finally { 
            w.close();
        } 
    } 
 
    protected File getExpectedFileFor(String testCaseFileName) throws IOException {
        return new File(getExpectedFileDirectory(), testCaseFileName);
    } 
     
    protected File getActualFileFor(String testCaseFileName) throws IOException {
        return new File(getActualFileDirectory(), deduceActualFileName(testCaseFileName));
    }