You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@daffodil.apache.org by GitBox <gi...@apache.org> on 2018/12/11 12:44:37 UTC

[GitHub] stevedlawrence commented on a change in pull request #146: Fix hexBinary with non-byte lengths or non-byte boundaries

stevedlawrence commented on a change in pull request #146: Fix hexBinary with non-byte lengths or non-byte boundaries
URL: https://github.com/apache/incubator-daffodil/pull/146#discussion_r240594594
 
 

 ##########
 File path: daffodil-runtime1/src/main/scala/org/apache/daffodil/processors/parsers/HexBinaryLengthParsers.scala
 ##########
 @@ -36,7 +37,30 @@ sealed abstract class HexBinaryLengthParser(override val context: ElementRuntime
     } else if (!dis.isDefinedForLength(nBits)) {
       PENotEnoughBits(start, nBits, dis.remainingBits)
     } else {
-      val array = start.dataInputStream.getByteArray(nBits, start)
+      // We cannot use dataInputStream.getByteArray(nBits) because that
+      // function takes into account byteOrder. hexBinary should completely
+      // ignore byteOrder, only taking into account bitOrder. To do this, we
+      // want to just repeatedly read 8 bit's at a time and add them to an
+      // ByteArray, effecitively ignoring bytOrder.
 
 Review comment:
   Fixed.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services