Created
April 21, 2022 13:20
-
-
Save 2439905184/1b389c60b502607fb8c7f73e229a8e2d to your computer and use it in GitHub Desktop.
android EasyFile (load)
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
package com.littlesandbox.libeasy; | |
import java.io.BufferedReader; | |
import java.io.File; | |
import java.io.FileNotFoundException; | |
import java.io.FileReader; | |
import java.io.IOException; | |
public class EasyFile | |
{ | |
private File f; | |
public EasyFile(String file_path) | |
{ | |
f=new File(file_path); | |
} | |
public EasyFile(File p_file) | |
{ | |
f=p_file; | |
} | |
public String readAll() throws FileNotFoundException, IOException | |
{ | |
FileReader fr= new FileReader(f); | |
BufferedReader br= new BufferedReader(fr); | |
String result=""; | |
String line; | |
while ((line=br.readLine())!=null) | |
{ | |
result+=line; | |
} | |
return result; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment