You can use this BER-TLV parser: source code on git.
Examples:
How to parse
byte[] bytes = HexUtil.parseHex("50045649534157131000023100000033D44122011003400000481F");
BerTlvParser parser = new BerTlvParser(LOG);
BerTlvs tlvs = parser.parse(bytes, 0, bytes.length);
How to build
byte[] bytes = new BerTlvBuilder()
.addHex(new BerTag(0x50), "56495341")
.addHex(new BerTag(0x57), "1000023100000033D44122011003400000481F")
.buildArray();
Maven dependency
<dependency>
<groupId>com.payneteasy</groupId>
<artifactId>ber-tlv</artifactId>
<version>1.0-10</version>
</dependency>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…