MCPcopy Create free account
hub / github.com/Qihoo360/poseidon / ReadFile

Method ReadFile

builder/index/src/main/java/InvertedIndex/plugin/Util.java:360–384  ·  view source on GitHub ↗
(String Path)

Source from the content-addressed store, hash-verified

358 }
359
360 public static String ReadFile(String Path) {
361 BufferedReader reader = null;
362 String laststr = "";
363 try {
364 FileInputStream fileInputStream = new FileInputStream(Path);
365 InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, "UTF-8");
366 reader = new BufferedReader(inputStreamReader);
367 String tempString = null;
368 while ((tempString = reader.readLine()) != null) {
369 laststr += tempString;
370 }
371 reader.close();
372 } catch (IOException e) {
373 e.printStackTrace();
374 } finally {
375 if (reader != null) {
376 try {
377 reader.close();
378 } catch (IOException e) {
379 e.printStackTrace();
380 }
381 }
382 }
383 return laststr;
384 }
385
386 public static String Compress(String data) {
387 ByteArrayInputStream bais = new ByteArrayInputStream(data.getBytes());

Callers 6

InitJsonParamsMethod · 0.95
InitJsonParamsMethod · 0.95
sumFunction · 0.80
readFileFunction · 0.80
SetMethod · 0.80
getNextMsgMethod · 0.80

Calls 2

readLineMethod · 0.45
closeMethod · 0.45

Tested by 2

sumFunction · 0.64
readFileFunction · 0.64