Skip to content

Instantly share code, notes, and snippets.

@matiasfha
Created October 1, 2013 19:48
Show Gist options
  • Save matiasfha/6784047 to your computer and use it in GitHub Desktop.
Save matiasfha/6784047 to your computer and use it in GitHub Desktop.
Ejemplo de lectura de archivo en java
StringBuffer texto = new StringBuffer();
try{
FileReader fr = new FileReader("archivo.txt");
entrada = new BufferedReader(fr);
String s;
while(s = entrada.readLine(fr)){
text.append(s);
}
entrada.close();
}catch(java.io.FilenotFoundException e){
System.out.println("Archivo no encontrado");
}catch(java.io.IOException e2){}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment