
com.payneteasy.tlv.BerTlvLogger Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ber-tlv Show documentation
Show all versions of ber-tlv Show documentation
BER-TLV reader and writer
package com.payneteasy.tlv;
public class BerTlvLogger {
public static void log(String aPadding, BerTlvs aTlv, IBerTlvLogger aLogger) {
for (BerTlv tlv : aTlv.getList()) {
log(aPadding, tlv, aLogger);
}
}
public static void log(String aPadding, BerTlv aTlv, IBerTlvLogger aLogger) {
if (aTlv == null) {
aLogger.debug("{} is null", aPadding);
return;
}
if (aTlv.isConstructed()) {
aLogger.debug("{} [{}]", aPadding, HexUtil.toHexString(aTlv.getTag().bytes));
for (BerTlv child : aTlv.getValues()) {
log(aPadding + " ", child, aLogger);
}
} else {
aLogger.debug("{} [{}] {}", aPadding, HexUtil.toHexString(aTlv.getTag().bytes), aTlv.getHexValue());
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy