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



##########
File path: 
daffodil-test/src/test/resources/org/apache/daffodil/layers/layers.tdml
##########
@@ -383,7 +383,7 @@ jones,arya,cat,1986-02-19
 
 We gzip that, and then we must prepend that with the length (as a binary 
4-byte int) before we base64 encode.
   -->
-      <tdml:documentPart type="text"  
replaceDFDLEntities="true"><![CDATA[AAAAcx+LCAAAAAAAAAAtyUEKgCAQheG94E1mIDWittG+M0xpaNQIo5tuX0Kb98P7LioVjiTf3sn7%CR;%LF;K8CyzlqVO9UIkrcgFTYh9pnBTOOInUPba3XmyOX7WiEGlqfxgJ1B6xpzKEDyEOxUf7JoJq1e/RI4%CR;%LF;wXIAAAA=--END--]]></tdml:documentPart>
+      <tdml:documentPart type="text"  
replaceDFDLEntities="true"><![CDATA[AAAAcx+LCAAAAAAAAP8tyUEKgCAQheG94E1mIDWittG+M0xpaNQIo5tuX0Kb98P7LioVjiTf3sn7%CR;%LF;K8CyzlqVO9UIkrcgFTYh9pnBTOOInUPba3XmyOX7WiEGlqfxgJ1B6xpzKEDyEOxUf7JoJq1e/RI4%CR;%LF;wXIAAAA=--END--]]></tdml:documentPart>

Review comment:
       Yeah, writing bytes one at a time is probably a bad idea, and was more 
just a snippet to get some discussions going. I've added a commit that adds 
this new GZIP fixer thing with extra logic so that it is essentially just a 
passthrouh to the underlying OutputStream after bad byte as been fixed. So 
there first 10 bytes or so might be a little slower, and there's going to be 
little bit of overhead to proxy calls to the underlying OutputStream, but I 
suspect that's minimal compared to the work needed to actually compress data.
   
   This does mean the GZIP layer is going to create slightly different data 
than before. If we really care, we could add a compatability tunable, and this 
fixer could set that 9th byte to 0 or 255 depending if you want the old or new 
Java behavior. Not sure if that's worth it though. But that seems like a bit of 
work for one byte that most people wont' care about. But at least we are now 
consistent regarldess of Java version, which is probably more important.




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


Reply via email to