Skip to content

Commit

Permalink
Use IOUtils.copy() in testCreateSplittedFiles()
Browse files Browse the repository at this point in the history
  • Loading branch information
garydgregory committed Mar 1, 2025
1 parent e99aea2 commit 03c85dd
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.nio.file.Files;

import org.apache.commons.compress.AbstractTest;
import org.apache.commons.io.IOUtils;
import org.junit.jupiter.api.Test;

public class ZipSplitOutputStreamTest extends AbstractTest {
Expand All @@ -39,11 +40,7 @@ public void testCreateSplittedFiles() throws IOException {
final File fileToTest = getFile("COMPRESS-477/split_zip_created_by_zip/zip_to_compare_created_by_zip.zip");
try (ZipSplitOutputStream zipSplitOutputStream = new ZipSplitOutputStream(testOutputFile, splitSize);
InputStream inputStream = Files.newInputStream(fileToTest.toPath())) {
final byte[] buffer = new byte[4096];
int readLen;
while ((readLen = inputStream.read(buffer)) > 0) {
zipSplitOutputStream.write(buffer, 0, readLen);
}
IOUtils.copy(inputStream, zipSplitOutputStream);
}
File zipFile = new File(getTempDirFile().getPath(), "testCreateSplittedFiles.z01");
assertEquals(zipFile.length(), splitSize);
Expand Down

0 comments on commit 03c85dd

Please sign in to comment.