Skip to content

Instantly share code, notes, and snippets.

@2439905184
Created April 21, 2022 13:20
Show Gist options
  • Save 2439905184/1b389c60b502607fb8c7f73e229a8e2d to your computer and use it in GitHub Desktop.
Save 2439905184/1b389c60b502607fb8c7f73e229a8e2d to your computer and use it in GitHub Desktop.
android EasyFile (load)
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