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

 ##########
 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:
   I think since the first line of the output informs the user about the 
consumed bits, the fact that the dump might include those bits might be ok. 
This dump is intended as a very rudimentary pointer at a possible issue in the 
data. The user could (and should) further analyze the issue if it isn't readily 
apparent from the dump, i think.

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