@@ -0,0 +1,1215 @@
+package com.javarush.task.task25.task2507;%0A%0Aimport java.io.IOException;%0Aimport java.io.InputStream;%0Aimport java.net.Socket;%0A%0A/* %0A%D0%A0%D0%B0%D0%B1%D0%BE%D1%82%D0%B0%D1%82%D1%8C %D0%B2 %D0%BF%D0%BE%D1%82%D0%B5 %D0%BB%D0%B8%D1%86%D0%B0!%0A*/%0Apublic class Solution extends Thread %7B%0A    private static final int BUFFER_SIZE = 2000;    //2000 bytes%0A    private final Socket socket;%0A    private final InputStream in;%0A%0A    public Solution(Socket socket) throws IOException %7B%0A        this.socket = socket;%0A        this.in = socket.getInputStream();%0A    %7D%0A%0A    public void interrupt() %7B%0A        //implement logic here%0A        try%0A        %7B%0A            socket.close();%0A            in.close();%0A        %7D%0A        catch (IOException ignored)%0A        %7B%0A        %7D%0A        finally%0A        %7B%0A            super.interrupt();%0A        %7D%0A    %7D%0A%0A    public void run() %7B%0A        try %7B%0A            byte%5B%5D buf = new byte%5BBUFFER_SIZE%5D;%0A            while (true) %7B%0A                int count = in.read(buf);%0A                if (count %3C 0) %7B%0A                    break;%0A                %7D else %7B%0A                    if (count %3E 0) %7B%0A                        //process buffer here%0A                    %7D%0A                %7D%0A            %7D%0A        %7D catch (IOException ignored) %7B%7D%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A    %7D%0A%7D%0A

Task --> 2507