Can anyone tell me what the issue might be here?
package com.codegym.task.task31.task3106;
/*
Unzipping a file
*/
import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
public class Solution {
public static void main(String[] args) throws IOException {
//String[] args = {"/home/onurbal101/Desktop/unzip_result", "/home/onurbal101/Desktop/destination.zip", "/home/onurbal101/Desktop/destination (copy).zip"};
String outputFileName = args[0];
ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream();
List<String> sortedZipPartNames = new ArrayList<>();
for (int i = 1; i < args.length; i++) {
sortedZipPartNames.add(args[i]);
}
sortedZipPartNames.sort(Comparator.naturalOrder());
for (String zipPartName : sortedZipPartNames) {
ZipInputStream zipStream = new ZipInputStream(new FileInputStream(zipPartName));
ZipEntry zipEntry;
while ( (zipEntry = zipStream.getNextEntry()) != null ) {
while (zipStream.available() == 1) {
byte[] buffer = new byte[1024];
zipStream.read(buffer);
byteOutputStream.write(buffer);
}
zipStream.closeEntry();
}
zipStream.close();
}
FileOutputStream fos = new FileOutputStream(outputFileName);
fos.write(byteOutputStream.toByteArray());
fos.close();
}
}