public class KlvDecoder extends Object
Constructor and Description |
---|
KlvDecoder(KlvContext klvContext)
Creates a
KlvDecoder with the given KlvContext . |
Modifier and Type | Method and Description |
---|---|
KlvContext |
decode(byte[] klvBytes)
Decodes the KLV data inside
klvBytes according to the properties in the KlvContext that was provided in the constructor. |
public KlvDecoder(KlvContext klvContext)
KlvDecoder
with the given KlvContext
.klvContext
- the KlvContext
containing the properties of the KLV data to be
decoded by this KlvDecoder
public KlvContext decode(byte[] klvBytes) throws KlvDecodingException
klvBytes
according to the properties in the KlvContext
that was provided in the constructor.
It will recursively decode any KlvLocalSet
s it
finds, provided that they are given in the KlvContext
.
The decoded KLV values are returned in a new KlvContext
object that has the same
structure as the KlvContext
that was provided in the constructor but contains only the
KlvDataElement
s that were found in the given bytes.
klvBytes
- bytes encoding data in KLV formatKlvContext
containing the decoded KLV data elementsIllegalArgumentException
- if klvBytes
is nullKlvDecodingException
- if the KLV cannot be decoded using the given context informationThis work is licensed under a Creative Commons Attribution 4.0 International License.