@@ -0,0 +1,1354 @@
+package net.yeputons.spbau.spring2016.torrent;%0A%0Aimport net.yeputons.spbau.spring2016.torrent.protocol.Request;%0A%0Aimport java.io.Closeable;%0Aimport java.io.DataInputStream;%0Aimport java.io.DataOutputStream;%0Aimport java.io.IOException;%0Aimport java.net.InetSocketAddress;%0Aimport java.net.Socket;%0A%0Apublic class TorrentConnection implements Closeable %7B%0A    private final Socket socket;%0A    private final DataInputStream in;%0A    private final DataOutputStream out;%0A%0A    public TorrentConnection(InetSocketAddress address) throws IOException %7B%0A        socket = new Socket(address.getAddress(), address.getPort());%0A        try %7B%0A            in = new DataInputStream(socket.getInputStream());%0A            out = new DataOutputStream(socket.getOutputStream());%0A        %7D catch (IOException e) %7B%0A            try %7B%0A                socket.close();%0A            %7D catch (IOException ignored) %7B%0A            %7D%0A            throw e;%0A        %7D%0A    %7D%0A%0A    public %3CT%3E T makeRequest(Request%3CT%3E r) throws IOException %7B%0A        return r.makeRequest(in, out);%0A    %7D%0A%0A    @Override%0A    public void close() %7B%0A        try %7B%0A            in.close();%0A        %7D catch (IOException ignored) %7B%0A        %7D%0A        try %7B%0A            out.close();%0A        %7D catch (IOException ignored) %7B%0A        %7D%0A        try %7B%0A            socket.close();%0A        %7D catch (IOException ignored) %7B%0A        %7D%0A    %7D%0A%7D%0A

Implement wrapping TorrentConnection class