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 2019/07/09 17:35:30 UTC
[GitHub] [incubator-daffodil] stevedlawrence commented on a change in pull
request #258: Adds bitawareness to left over data dump
stevedlawrence commented on a change in pull request #258: Adds bitawareness to left over data dump
URL: https://github.com/apache/incubator-daffodil/pull/258#discussion_r301708975
##########
File path: daffodil-cli/src/main/scala/org/apache/daffodil/Main.scala
##########
@@ -908,21 +911,36 @@ object Main extends Logging {
} else {
// not streaming, show left over data warning
val Dump = new DataDumper
- val curPositionInByte0b = inStream.inputSource.position
+ val firstByteBitArray = new Array[Byte](1)
+ val bitsAlreadyConsumed = loc.bitPos0b % 8
+ val firstByteString = if (bitsAlreadyConsumed != 0) {
+ val bitsToDisplay = 8 - bitsAlreadyConsumed
+ val pbp = inStream.inputSource.position + 1
+ inStream.fillByteArray(firstByteBitArray, bitsToDisplay, finfo)
Review comment:
Is it possible to use ``inStream.getByteArray()`` instead of making fillByteArray public? It's probably not a big deal if that's made public, but ideally it should only be used internally since it doesn't do any sanity checking like other functions do.
----------------------------------------------------------------
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:
users@infra.apache.org
With regards,
Apache Git Services