Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package testapp;
- import java.io.BufferedReader;
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.io.FileReader;
- import java.io.IOException;
- import java.util.logging.Level;
- import java.util.logging.Logger;
- /**
- *
- * @author amigojapan
- */
- public class FileIn {
- private String data;
- public FileIn(String filename,String encoding) throws FileNotFoundException, IOException {//implementing encoding later
- BufferedReader reader;
- reader = new BufferedReader(new FileReader(filename)); //Implement encoding later, see http://www.mkyong.com/java/how-to-read-utf-8-encoded-data-from-a-file-java/
- String line = "";
- this.data="";
- while ((line = reader.readLine()) != null) {
- this.data+=line+"\n";
- }
- }
- public String GetData() {
- return this.data;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement