У меня есть код, который заполняет два массива int [] числами от 0 до 255.Мне нужно, чтобы можно было прочитать файл и сгруппировать все остальные целые числа, например, мой файл - 0 12 85 45 20 14 255 145, мне нужно составить пары, которые будут 0-12, 85-45, 20-14, 255-145.Есть ли у вас какие-либо предложения?
try {
DataInputStream dis = new DataInputStream(new FileInputStream(new File("input.txt")));
DataOutputStream dos = new DataOutputStream(new FileOutputStream(new File("output.txt")));
int[] i = new int[256];
int[] j = new int[256];
for (int k = 0; k < 256; k++) {
i[k] = k;
for (int l = 0; l < 256; l++) {
j[l] = l;
System.out.println(k + " " + l);
}
}
//the int pairing should be here
//but I have no idea how to pair the integers from the input.txt file
}