jadams-tresys commented on a change in pull request #448:
URL: https://github.com/apache/incubator-daffodil/pull/448#discussion_r512678318



##########
File path: 
daffodil-io/src/main/scala/org/apache/daffodil/io/DirectOrBufferedDataOutputStream.scala
##########
@@ -885,8 +885,10 @@ class DirectOrBufferedDataOutputStream private[io] (
               bufOS.getFile.delete()
           }
           nBitsPut / 8
-        } else
-          directDOS.putBytes(bufOS.getBuf, 0, nBytes, finfo)
+        } else {
+          Assert.usage(nBytes <= Int.MaxValue)

Review comment:
       So funnily enough, I originally had it as an Assert.invariant, but then 
I saw elsewhere in the code where we were doing the same Int.MaxValue check, it 
was using Assert.usage and I changed my code to match.  I'll update my code to 
be invariant, but would you want me to update the other assert too?
   
   I'll also remove the duplicate code too, missed that when I was working on 
this yesterday.




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