Skip to content

CBOR: read object from byte array and get the offset to the end of the read object in array #125

Answered by martinpaljak
martinpaljak asked this question in Q&A
Discussion options

You must be logged in to vote

Answering my own question:

CBORFactory cf = new CBORFactory();
cf.setCodec(new CBORMapper());
CBORParser parser = cf.createParser(cbor);
System.out.println("start: "  + parser.getCurrentLocation().getByteOffset());
JsonNode object = parser.readValueAsTree();
System.out.println("stop: "  + parser.getCurrentLocation().getByteOffset());

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by martinpaljak
Comment options

You must be logged in to vote
9 replies
@martinpaljak
Comment options

@cowtowncoder
Comment options

@martinpaljak
Comment options

@martinpaljak
Comment options

@cowtowncoder
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants