Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.IOException;
- import java.io.FileReader;
- import java.io.BufferedReader;
- public class ReadJournal {
- private String path;
- public ReadJournal(String file_path) {
- path = file_path;
- }
- int readLines() throws IOException {
- FileReader fr = new FileReader(path);
- BufferedReader bf = new BufferedReader(fr);
- String line;
- int lineNr = 0;
- while ((line = bf.readLine()) != null) {
- lineNr++;
- }
- bf.close();
- return lineNr;
- }
- public String[] OpenFile() throws IOException {
- FileReader fr = new FileReader (path);
- BufferedReader tr = new BufferedReader(fr);
- int lineNr = readLines();
- String[] textData = new String[lineNr];
- int i;
- for (i=0; i < lineNr; i++) {
- }
- tr.close();
- return textData;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement