опять не ясно
package com.javarush.task.task18.task1827;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.stream.IntStream;
/*
Собираем файл
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
String fileNamich = bufferedReader.readLine();
bufferedReader.close();
ArrayList<Integer> numbersList = new ArrayList<>();
IntStream.rangeClosed(48, 57).forEach(numbersList::add);
if (args.length > 0) {
if (args[0].equals("-c")) {
ArrayList<Character> idList = Methods.getIDArrayList(Methods.getNextID(fileNamich, numbersList));
ArrayList<Character> productNameList = Methods.getProductName(args[1]);
ArrayList<Character> priceList = Methods.getPrice(String.valueOf(args[2]));
ArrayList<Character> quantityList = Methods.getQuantity(String.valueOf(args[3]));
final String[] finalString = {"\n"};
idList.forEach(c -> finalString[0] += c);
productNameList.forEach(c -> finalString[0] += c);
priceList.forEach(c -> finalString[0] += c);
quantityList.forEach(c -> finalString[0] += c);
FileOutputStream fileOutputStream = new FileOutputStream(fileNamich, true);
byte[] bytes = finalString[0].getBytes(StandardCharsets.UTF_8);
fileOutputStream.write(bytes);
fileOutputStream.close();
}
}
}
}