Skip to content

Instantly share code, notes, and snippets.

@marciojrtorres
Last active December 20, 2015 16:19
Show Gist options
  • Save marciojrtorres/6160579 to your computer and use it in GitHub Desktop.
Save marciojrtorres/6160579 to your computer and use it in GitHub Desktop.
Falando em coincidência, este código SEMPRE funciona?
public static void armazena(String texto) throws Exception {
FileWriter fw = new FileWriter("/tmp/app-temp.txt", true);
fw.write(s);
fw.flush();
fw.close();
}
public static String recupera() throws Exception {
BufferedReader br = new BufferedReader(new FileReader("/tmp/app-temp.txt"));
String linha = null;
String conteudo = "";
while((linha=br.readLine()) != null) {
conteudo += linha;
}
br.close();
return conteudo;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment