Class: ElementReader

ElementReader(elementListener)

new ElementReader(elementListener)

A ElementReader lets you call onReceivedData multiple times which uses a TlvStructureDecoder to detect the end of a TLV element and calls elementListener.onReceivedElement(element) with the element. This handles the case where a single call to onReceivedData may contain multiple elements.
Parameters:
Name Type Description
elementListener object An object with an onReceivedElement method.
Source:

Methods

onReceivedData(data)

Continue to read data until the end of an element, then call this.elementListener_.onReceivedElement(element). The buffer passed to onReceivedElement is only valid during this call. If you need the data later, you must copy.
Parameters:
Name Type Description
data Buffer The Buffer with the incoming element's bytes.
Source: