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 2021/12/01 19:43:30 UTC

[commons-compress] branch master updated: Use NIO in test.

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 7df3689  Use NIO in test.
7df3689 is described below

commit 7df368952fe27bc23e23b824aa711b3ed5d23311
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Dec 1 14:43:28 2021 -0500

    Use NIO in test.
---
 .../java/org/apache/commons/compress/compressors/XZTestCase.java     | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/test/java/org/apache/commons/compress/compressors/XZTestCase.java b/src/test/java/org/apache/commons/compress/compressors/XZTestCase.java
index 0c03748..9b72587 100644
--- a/src/test/java/org/apache/commons/compress/compressors/XZTestCase.java
+++ b/src/test/java/org/apache/commons/compress/compressors/XZTestCase.java
@@ -51,9 +51,8 @@ public final class XZTestCase extends AbstractTestCase {
         final File input = getFile("bla.tar.xz");
         final File output = new File(dir, "bla.tar");
         try (InputStream is = Files.newInputStream(input.toPath())) {
-            try (CompressorInputStream in = new CompressorStreamFactory().createCompressorInputStream("xz", is);
-                OutputStream out = Files.newOutputStream(output.toPath())) {
-                IOUtils.copy(in, out);
+            try (CompressorInputStream in = new CompressorStreamFactory().createCompressorInputStream("xz", is)) {
+                Files.copy(in, output.toPath());
             }
         }
     }