stevedlawrence commented on a change in pull request #12: Revised daffodil-io 
module to require passing in a FormatInfo object.
URL: https://github.com/apache/incubator-daffodil/pull/12#discussion_r158032054
 
 

 ##########
 File path: 
daffodil-io/src/main/scala/edu/illinois/ncsa/daffodil/io/DirectOrBufferedDataOutputStream.scala
 ##########
 @@ -704,23 +724,27 @@ object DirectOrBufferedDataOutputStream {
    * Delivers the bits of bufDOS into directDOS's output stream. Deals with 
the possibility that
    * the directDOS ends with a fragment byte, or the bufDOS does, or both.
    */
-  private def deliverBufferContent(directDOS: 
DirectOrBufferedDataOutputStream, bufDOS: DirectOrBufferedDataOutputStream, 
finfo: FormatInfo) {
+  private def deliverBufferContent(directDOS: DirectOrBufferedDataOutputStream,
+    bufDOS: DirectOrBufferedDataOutputStream,
+    finfo: FormatInfo) {
     Assert.invariant(bufDOS.isBuffering)
     Assert.invariant(!directDOS.isBuffering)
 
     val ba = bufDOS.bufferingJOS.getBuf
     val bufferNBits = bufDOS.relBitPos0b // don't have to subtract a starting 
offset. It's always zero in buffered case.
 
-    if (finfo.bitOrder ne directDOS.cst.priorBitOrder) {
-      if (!directDOS.isEndOnByteBoundary) {
+    val finfoBitOrder = finfo.bitOrder // bit order we are supposed to write 
with
+    val priorBitOrder = directDOS.cst.priorBitOrder // bit order that the 
directDOS has.
 
 Review comment:
   Should this just be directDOS.cst.bitOrder rather than 
directDOS.cst.priorBitOrder? So as to compare against current bitOrder of the 
direct DOS? Or maybe directDOS.cst.priorBitOrder should be the same as 
directDOS.cst.bitOrder at this point and it doesn't matter?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to