stevedlawrence commented on a change in pull request #641:
URL: https://github.com/apache/daffodil/pull/641#discussion_r714718541



##########
File path: 
daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/DataProcessor.scala
##########
@@ -357,7 +357,14 @@ class DataProcessor private (
 
   def save(output: DFDL.Output): Unit = {
 
-    val oos = new ObjectOutputStream(new 
GZIPOutputStream(Channels.newOutputStream(output)))
+    val os = Channels.newOutputStream(output)
+
+    // write a null-terminated ASCII string as a simple version identifier
+    val headerString = "DAFFODIL " + Misc.getDaffodilVersion + "\u0000"
+    os.write(headerString.getBytes("US-ASCII"))

Review comment:
       Agreed. It looks like most uses (maybe all?) of `getBytes` without an 
encoding are in tests, so I"m not sure there's a bug in Daffodil proper. But it 
does mean our tests are possibly fragile to the system default encoding which 
we definitely don't want. And improving is definitely worth it.
   
   I've created 
[DAFFODIL-2561](https://issues.apache.org/jira/browse/DAFFODIL-2561) for this. 
I'll also update this to use "utf-8" encoding for conistency.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to