Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void Skaityti(String failas) throws IOException {
- BufferedReader br = new BufferedReader(new FileReader(failas));
- try {
- StringBuilder sb = new StringBuilder();
- String line = br.readLine();
- while (line != null) {
- sb.append(line);
- sb.append(System.lineSeparator());
- System.out.println(line);
- line = br.readLine();
- }
- String everything = sb.toString();
- } catch (FileNotFoundException ex) {
- System.out.println("Failas nerastas");
- } finally {
- br.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement