MCPcopy Create free account
hub / github.com/Bit0r/java-util / readFileAll

Method readFileAll

src/main/java/util/AddTableField.java:62–73  ·  view source on GitHub ↗

按行读取全部文件数据 @param strFile

(String strFile)

Source from the content-addressed store, hash-verified

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 * 写入文件

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected