import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; public class Sort { public static String[] threadedSort (File[] files) throws IOException { throw new java.lang.IllegalStateException ("Method not implemented"); } public static String[] sort(File[] files) throws IOException { String[] sortedData = new String[0]; for (File file : files) { String[] data = getData(file); data = MergeSort.mergeSort (data); MergeSort.merge(sortedData, data); } return sortedData; } private static String[] getData(File file) throws IOException { ArrayList<String> data = new ArrayList<String>(); BufferedReader in = new BufferedReader 9new FileReader(file)); while (true) { String line = in.readLine(); if (line ==null) { break; } else { data.add(line); } } in.close(); return data.toArray(new String[0]); } }