@@ -0,0 +1,1589 @@
+package ru.szhernovoy;%0A%0Aimport java.io.BufferedReader;%0Aimport java.io.FileInputStream;%0Aimport java.io.Reader;%0A%0A/**%0A * Created by admin on 19.07.2016.%0A */%0Apublic class ChatConsole %7B%0A    private final String STOP = %22%D1%81%D1%82%D0%BE%D0%BF%22;%0A    private final String CONTINUE_CHAT = %22%D0%BF%D1%80%D0%BE%D0%B4%D0%BE%D0%BB%D0%B6%D0%B8%D1%82%D1%8C%22;%0A    private final String EXIT = %22%D0%B7%D0%B0%D0%BA%D0%BE%D0%BD%D1%87%D0%B8%D1%82%D1%8C%22;%0A    private final String filename = %22resources%5C%5CChat.txt%22;%0A    private FileInputStream fs;%0A%0A    public ChatConsole()%7B%0A%0A    %7D%0A%0A    public void init(Reader in)%7B%0A        BufferedReader br = new BufferedReader(in);%0A        do%7B%0A%0A        %7D%0A        while(true);%0A    %7D%0A%0A    public void writeMessage(String message)%7B%0A%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        ChatConsole cs = new ChatConsole();%0A%0A    %7D%0A%0A    try (BufferedReader br = new BufferedReader(new FileReader(%22C:%5C%5Ctesting.txt%22)))%0A    %7B%0A%0A        String sCurrentLine;%0A%0A        while ((sCurrentLine = br.readLine()) != null) %7B%0A            System.out.println(sCurrentLine);%0A        %7D%0A%0A    %7D catch (IOException e) %7B%0A        e.printStackTrace();%0A    %7D%0A%0A    File file = new File(%22c:/newfile.txt%22);%0A    String content = %22This is the text content%22;%0A%0A%09%09try (FileOutputStream fop = new FileOutputStream(file)) %7B%0A%0A        // if file doesn't exists, then create it%0A        if (!file.exists()) %7B%0A            file.createNewFile();%0A        %7D%0A%0A        // get the content in bytes%0A        byte%5B%5D contentInBytes = content.getBytes();%0A%0A        fop.write(contentInBytes);%0A        fop.flush();%0A        fop.close();%0A%0A        System.out.println(%22Done%22);%0A%0A    %7D catch (IOException e) %7B%0A        e.printStackTrace();%0A    %7D%0A%7D%0A%0A%7D%0A

update lesson1 chat console