Code example for InputStreamReader

Methods: close, read

0
		JGitTestUtil.deleteTrashFile(db, name);
	} 
 
	protected static void checkFile(File f, final String checkData)
			throws IOException { 
		Reader r = new InputStreamReader(new FileInputStream(f), "ISO-8859-1");
		try { 
			char[] data = new char[(int) f.length()];
			if (f.length() !=  r.read(data))
				throw new IOException("Internal error reading file data from "+f);
			assertEquals(checkData, new String(data));
		} finally { 
			r.close();
		} 
	} 
 
	/** Test repository, initialized for this test case. */ 
	protected FileRepository db;
 
	/** Working directory of {@link #db}. */ 
	protected File trash;