Created
April 13, 2016 15:18
-
-
Save ckob/907c7d474b3e7eec2e581d6952ac555d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public BookTxt(String filePath) { | |
this.filePath = filePath; | |
BufferedReader br = null; | |
try { | |
br = new BufferedReader(new FileReader(this.filePath)); | |
strFitxer = new ArrayList<>(5000); // 5k de linies inicials, falta buscar quantes serien més aproximadament a partir del tamany del fitxer. | |
String actualLine; | |
while ((actualLine = br.readLine()) != null) { | |
strFitxer.add(actualLine); | |
} | |
} catch (Exception e) { | |
e.printStackTrace(); | |
} finally { | |
try { | |
if (br != null) | |
br.close(); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment