You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2024/01/14 20:53:08 UTC
(commons-compress) branch master updated: Use NIO
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-compress.git
The following commit(s) were added to refs/heads/master by this push:
new 8423c28eb Use NIO
8423c28eb is described below
commit 8423c28eb8ffab2fbf484c2d60b3d673c7564826
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Jan 14 15:53:04 2024 -0500
Use NIO
---
src/test/java/org/apache/commons/compress/archivers/ZipTest.java | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/src/test/java/org/apache/commons/compress/archivers/ZipTest.java b/src/test/java/org/apache/commons/compress/archivers/ZipTest.java
index 7d28baf4e..fb2b6493b 100644
--- a/src/test/java/org/apache/commons/compress/archivers/ZipTest.java
+++ b/src/test/java/org/apache/commons/compress/archivers/ZipTest.java
@@ -671,12 +671,8 @@ public final class ZipTest extends AbstractTest {
*/
@Test
public void testZipArchiveCreationInMemory() throws Exception {
- final File file1 = getFile("test1.xml");
- final File file2 = getFile("test2.xml");
- final byte[] file1Contents = new byte[(int) file1.length()];
- final byte[] file2Contents = new byte[(int) file2.length()];
- IOUtils.read(file1, file1Contents);
- IOUtils.read(file2, file2Contents);
+ final byte[] file1Contents = Files.readAllBytes(getPath("test1.xml"));
+ final byte[] file2Contents = Files.readAllBytes(getPath("test2.xml"));
final List<byte[]> results = new ArrayList<>();
try (SeekableInMemoryByteChannel channel = new SeekableInMemoryByteChannel()) {