package alx.p42_tekstowe;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

public class Odczyt1_FileReader {

    public static void main(String[] args) {
        try(FileReader in = new FileReader("pan-tadeusz.txt")) {
            char[] porcja = new char[100];
            int ile;
            while((ile = in.read(porcja)) != -1) {
                String tekst = new String(porcja, 0, ile);
                System.out.println("[" + tekst + "]");
            }

        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
