Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.FileReader; import java.io.FileWriter;
- public class arquivo {
- public static void gravar(String urlArquivo, String conteudo) throws Exception {
- FileWriter pegarConteudo = new FileWriter(urlArquivo, false);
- conteudo = "";
- pegarConteudo.write(conteudo);
- pegarConteudo.close();
- }
- public static String abrir(String urlArquivo) throws Exception {
- FileReader y = new FileReader(urlArquivo);
- String conteudo = "";
- int i;
- while((i=y.read())!=1) {
- conteudo = conteudo+(char)i;
- }
- y.close();
- return conteudo;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement