Не могу понять в чём проблема - программа работает правильно.
package com.javarush.task.task18.task1818;
/*
Два в одном
*/
import java.io.FileInputStream;
import java.io.FileOutputStream;
public class Solution {
public static void main(String[] args) throws Exception {
if (args.length <= 3 && args.length != 0) {
FileOutputStream fos1 = new FileOutputStream(args[0]);
FileInputStream fis1 = new FileInputStream(args[1]);
FileInputStream fis2 = new FileInputStream(args[2]);
byte[] buff1 = new byte[fis1.available()];
fis1.read(buff1);
byte[] buff2 = new byte[fis2.available()];
fis2.read(buff2);
byte[] buff3 = new byte[buff1.length + buff2.length];
int count = 0;
for (byte s : buff1) {
buff3[count] = s;
count++;
}
for (byte c : buff2) {
buff3[count] = c;
count++;
}
fos1.write(buff3);
fis1.close();
fis2.close();
fos1.close();
}
}
}