@@ -0,0 +1,1372 @@
+package ru.matevosyan;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.io.RandomAccessFile;%0A%0A/**%0A * Created SortFile for sort big file and write it to a new file.%0A * Created on 19.02.2017.%0A * @since 1.0%0A * @author Matevosyan Vardan%0A * @version 1.0%0A */%0A%0Apublic class SortFile %7B%0A%0A    public void sort(File source, File dist) throws IOException%7B%0A//        String pathSource = %22C://Abbat.txt%22;%0A//        source = new File(pathSource);%0A%0A        try (RandomAccessFile toRead = new RandomAccessFile(source, %22r%22);%0A                RandomAccessFile otWrite = new RandomAccessFile(dist, %22w%22)) %7B%0A            int countEnd = 500;%0A            int countStart = 0;%0A            toRead.seek(countStart);%0A            String%5B%5D read = new String%5B500%5D;%0A            String%5B%5D read2 = new String%5B500%5D;%0A            String%5B%5D read3 = new String%5B500%5D;%0A            int i = 0;%0A            while (countStart %3C countEnd) %7B%0A                read%5Bi++%5D = toRead.readLine();%0A                countStart = countEnd;%0A                countEnd += 500;%0A                toRead.seek(countStart);%0A%0A                while (countStart %3C countEnd) %7B%0A                    read2%5Bi++%5D = toRead.readLine();%0A                    countStart++;%0A                %7D%0A                countStart++;%0A            %7D%0A%0A            %7D catch (IOException ioe) %7B%0A            System.out.println(ioe.getMessage());%0A        %7D%0A%0A%0A    %7D%0A%0A%7D%0A

add SortFile