mbeckerle commented on a change in pull request #254: Adds hex/utf-8 data dump 
on left over data
URL: https://github.com/apache/incubator-daffodil/pull/254#discussion_r298588795
 
 

 ##########
 File path: daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala
 ##########
 @@ -905,13 +907,26 @@ object Main extends Logging {
                     }
                   } else {
                     // not streaming, show left over data warning
+                    val Dump = new DataDumper
+                    var (dataText, dataHex) = ("", "")
+                    var curPositionInByte0b = inStream.inputSource.position
+                    var bytesAvailable = inStream.inputSource.bytesAvailable
+                    var bytesLimit = math.min(8, bytesAvailable).toInt
+                    val destArray = new Array[Byte](bytesLimit)
+                    val ret = inStream.inputSource.get(destArray, 0, 
bytesLimit)
 
 Review comment:
   It is an issue, and we debug a lot of data like this.
   
   If we were going to try to address this, we could add to the dump a 
first-byte-of-dump key, which is only presented if the data ends mid-byte 
somwhere. It would be an individual-bits picture of the first byte of the 
left-over data. 
   If say, the data ended at bit 5, and bit order is mostSignificantBitFirst, 
then this picture would look like xxxxx000 (where the 0's are the actual left 
over data bits in that first byte of the left over data.) If bitOrder is 
leastSignificantBitFirst the picture would look like 000xxxxx. 
   I suggest this sort of enhancement would be best as a separate JIRA ticket 
however, as this is not thought through. 

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


With regards,
Apache Git Services

Reply via email to