请尝试以下方法:
InputStreamReader isReader= new InputStreamReader( this.getClass().getResourceAsStream(templateName)); BufferedReader br = new BufferedReader(isReader);
要么
InputStreamReader isReader= new InputStreamReader( <youclassName>.class.getResourceAsStream(templateName)); BufferedReader br = new BufferedReader(isReader);
对于输出,请尝试以下 *** 作:
PrintWriter writer = new PrintWriter( new File(this.getClass().getResource(templateName).getPath());
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)