You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Steve Lawrence (Jira)" <ji...@apache.org> on 2022/01/29 22:41:00 UTC

[jira] [Commented] (DAFFODIL-2639) InputSourceDataInputStream needs to support bitPos1b

    [ https://issues.apache.org/jira/browse/DAFFODIL-2639?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17484248#comment-17484248 ] 

Steve Lawrence commented on DAFFODIL-2639:
------------------------------------------

As a workaround, the {{ParseResult}} has a public {{location()}} member that returns a {{DataLocation}} pointing to where the parse ended. And that {{DataLocation}} has a public {{bitPos1b}} function . So if you have access to he most recent {{ParseResult}} you could do {{pr.location.bitPos1b}}.

I do agree that it does feel bit more natural in some cases like you describe to ask the {{InputSourceDataInputStream}} for that information rather than having to keep track of where the previous parse ended.

> InputSourceDataInputStream needs to support bitPos1b
> ----------------------------------------------------
>
>                 Key: DAFFODIL-2639
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2639
>             Project: Daffodil
>          Issue Type: New Feature
>          Components: Back End
>    Affects Versions: 3.2.1
>            Reporter: Mike Beckerle
>            Priority: Major
>
> It would be very useful when using Daffodil to parse a stream of data into messages or records, to be able to ask the inputSourceDataInputStream for its position between calls to parse. 
> For this to be meaningful; however, the stream must be positioned at the next bit to read in order to consume the next message. That is, any speculative reads must have been backtracked, not stored as state in Daffodil. 
> The point is to be able to output along with each message, its starting position in the input data stream, thereby discovering the boundary positions in the input stream where each of the messages/records starts, and the length (by looking at the next starting position)
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)