liugddx commented on code in PR #7086:
URL: https://github.com/apache/seatunnel/pull/7086#discussion_r1678833585


##########
seatunnel-e2e/seatunnel-connector-v2-e2e/connector-file-local-e2e/src/test/java/org/apache/seatunnel/e2e/connector/file/local/LocalFileIT.java:
##########
@@ -267,11 +267,21 @@ public void testLocalFileCatalog(TestContainer container)
     }
 
     private Path convertToLzoFile(File file) throws IOException {
-        LzopCodec lzo = new LzopCodec();
-        Path path = Paths.get(file.getAbsolutePath() + ".lzo");
-        OutputStream outputStream = 
lzo.createOutputStream(Files.newOutputStream(path));
-        outputStream.write(Files.readAllBytes(file.toPath()));
-        outputStream.close();
+        // Define the output path
+        Path path = Paths.get(file.getAbsolutePath() + ".lzma");
+
+        // Use try-with-resources to ensure streams are closed properly
+        try (FileInputStream fis = new FileInputStream(file);
+                FileOutputStream fos = new FileOutputStream(path.toFile());
+                LZMACompressorOutputStream lzmaOut = new 
LZMACompressorOutputStream(fos)) {
+
+            byte[] buffer = new byte[1024];
+            int len;
+            while ((len = fis.read(buffer)) != -1) {
+                lzmaOut.write(buffer, 0, len);
+            }
+        }
+

Review Comment:
   Resolve `Caused by: java.lang.ExceptionInInitializerError: Exception 
java.lang.RuntimeException: java.lang.reflect.InaccessibleObjectException: 
Unable to make field long java.nio.Buffer.address accessible: module java.base 
does not "opens java.nio" to unnamed module @3025782f [in thread "main"]`.  
Skip jdk17 test environment
   
   
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to