CBOR: read object from byte array and get the offset to the end of the read object in array #125
-
I have a byte array containing CBOR object and additional data after it. I'd like to read that object with Jackson tools and get the offset in the array where this object ends and other data starts. Is that exposed somehow or possible without going into too internals? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
Answering my own question:
|
Beta Was this translation helpful? Give feedback.
-
Right, there TWO locations: one is the START of the currently available token: the other is current location by parser, typically AFTER the token but not necessarily, in case of things like lazy decoding. The reliable way would be to get the START location of the token AFTER one you are interested in. The current location would work in case you ensure that you access whatever data token has (getText() or similar). |
Beta Was this translation helpful? Give feedback.
Answering my own question: