Created
January 18, 2017 12:13
-
-
Save gustavoapolinario/c4aa49b708231ded21af01d9b09e9f9c to your computer and use it in GitHub Desktop.
Le arquivo no java
This file contains 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
private String leArquivo(String nome) { | |
String linha = ""; | |
StringBuilder conteudoArquivo = new StringBuilder(); | |
try { | |
FileReader arq = new FileReader(nome); | |
BufferedReader lerArq = new BufferedReader(arq); | |
while (linha != null) { | |
linha = lerArq.readLine(); | |
conteudoArquivo.append(linha); | |
} | |
arq.close(); | |
} catch (IOException e) { | |
UtExceptionMaestro.logarException(Thread.currentThread(), e, LevelLog.ERROR); | |
} | |
return conteudoArquivo.toString(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment