Class: TlvStructureDecoder

TlvStructureDecoder

new TlvStructureDecoder()

Create and initialize a TlvStructureDecoder.
Source:

Methods

findElementEnd(input) → {boolean}

Continue scanning input starting from this.offset to find the element end. If the end of the element which started at offset 0 is found, this returns true and getOffset() is the length of the element. Otherwise, this returns false which means you should read more into input and call again.
Parameters:
Name Type Description
input Buffer The input buffer. You have to pass in input each time because the buffer could be reallocated.
Source:
Returns:
true if found the element end, false if not.
Type
boolean

getOffset() → {number}

Get the current offset into the input buffer.
Source:
Returns:
The offset.
Type
number

seek(offset)

Set the offset into the input, used for the next read.
Parameters:
Name Type Description
offset number The new offset.
Source: