You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/01/29 08:57:48 UTC

[GitHub] [beam] iemejia commented on a change in pull request #13821: [BEAM-11658] match .snappy files into the given (de)compressor

iemejia commented on a change in pull request #13821:
URL: https://github.com/apache/beam/pull/13821#discussion_r566661345



##########
File path: sdks/java/core/src/test/java/org/apache/beam/sdk/io/CompressedSourceTest.java
##########
@@ -907,30 +1052,33 @@ public void close() throws IOException {
   }
 
   /** Writes a single output file. */
-  private void writeFile(File file, byte[] input, CompressionMode mode) throws IOException {
-    try (OutputStream os = getOutputStreamForMode(mode, new FileOutputStream(file))) {
-      os.write(input);
+  private void writeFile(File file, byte[] input, Compression compression) throws IOException {
+    if (compression == Compression.SNAPPY) {
+      try (OutputStream os =
+          getOutputStreamForModeWithDecompressedSizeInfo(

Review comment:
       Please add the `byte[] input` as a new parameter of `getOutputStreamForMode` so we can better deal with the case specifics there. 




----------------------------------------------------------------
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.

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