📄 test.java
字号:
package com.jdon.cms;
import java.io.*;
import com.jdon.util.*;
import com.jdon.cms.template.JspMaker;
public class Test {
public static String readFile(String input) throws Exception {
char[] buffer = new char[1];
int len = 0;
StringBuffer content = null;
String ENCODING = "UTF-8";
try {
InputStreamReader fr = new InputStreamReader(new FileInputStream(input),
ENCODING);
BufferedReader br = new BufferedReader(fr);
content = new StringBuffer();
while ( (len = br.read(buffer)) > -1) {
System.out.println(buffer);
content.append(buffer, 0, len);
}
br.close();
fr.close();
} catch (Exception e) {
throw new Exception(e);
}
return content.toString();
}
public static void main(String[] args) {
try {
String jspTemplateFile = "D:\\javasource\\CMS\\web\\1.jsp";
String text = readFile(jspTemplateFile);
System.out.println("" + text);
} catch (Exception e) {
System.out.println("Uh oh, got an IOException error!");
e.printStackTrace();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -