按行读取全部文件数据 @param strFile
(String strFile)
| 60 | * @param strFile |
| 61 | */ |
| 62 | public static StringBuffer readFileAll(String strFile) throws IOException { |
| 63 | StringBuffer strSb = new StringBuffer(); |
| 64 | InputStreamReader inStrR = new InputStreamReader(new FileInputStream(strFile), "UTF-8"); |
| 65 | // character streams |
| 66 | BufferedReader br = new BufferedReader(inStrR); |
| 67 | String line = br.readLine(); |
| 68 | while (line != null) { |
| 69 | strSb.append(line).append("\r\n"); |
| 70 | line = br.readLine(); |
| 71 | } |
| 72 | return strSb; |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * 写入文件 |
nothing calls this directly
no outgoing calls
no test coverage detected