public static void writeContentDersToZip(int filesCount, String zipFilePath, byte[]…
- User
public static void writeContentDersToZip(int filesCount, String zipFilePath, byte[] derRequest) { try (FileOutputStream fos = new FileOutputStream(zipFilePath); ZipOutputStream zos = new ZipOutputStream(fos)) {
IntStream.range(0, filesCount).parallel().forEach(i -> { try { String entryName = "validContent" + i + ".der"; synchronized (zos) { ZipEntry zipEntry = new ZipEntry(entryName); zos.putNextEntry(zipEntry); zos.write(derRequest); zos.closeEntry(); } } catch (IOException e) { log.error("error writing zip content", e); throw new RuntimeException(e); } }); } catch (IOException e) { log.error("error writeContentDersToZip", e); throw new RuntimeException(e); } }перепиши так, чтобы записывать в файлы строки, а не массив байт
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.