BerTlv is a java library for parsing and building BER TLV encoded data.
- supported types: amount, date, time, text, BCD, bytes
- thread safe (provides immutable container BerTlv)
- production ready (uses in several projects)
- lightweight (no external dependencies)
<dependency>
<groupId>com.payneteasy</groupId>
<artifactId>ber-tlv</artifactId>
<version>1.0-11</version>
</dependency>
implementation 'com.payneteasy:ber-tlv:1.0-11'
byte[] bytes = HexUtil.parseHex("50045649534157131000023100000033D44122011003400000481F");
BerTlvParser parser = new BerTlvParser(LOG);
BerTlvs tlvs = parser.parse(bytes, 0, bytes.length);
BerTlvLogger.log(" ", tlvs, LOG);
byte[] bytes = new BerTlvBuilder()
.addHex(new BerTag(0x50), "56495341")
.addHex(new BerTag(0x57), "1000023100000033D44122011003400000481F")
.buildArray();
The BerTlv framework is licensed under the Apache License 2.0