A simple TLV parser
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Melua 3f5ded9bae Update method name 4 days ago
src Update method name 4 days ago
.gitignore First commit 1 year ago
LICENSE.txt First commit 1 year ago
README.md Refactoring 1 month ago
pom.xml Refactoring 1 month ago

README.md

MiniTLV: a simple TLV parser

MinitTLV let you convert your UTF-8 String into a Type-Length-Value byte array and reciprocally. The result is as short as possible without compression. The type and length have a dynamically resolved size (1, 2 or 4 bytes) using the 0x00 reserved byte for extension. The value field is of variable size (up to 232-1). Additionally you can compress and/or encrypt serialized data.

Method Description
getWriter Create a new instance of Serializer (using your own Converter or not).
getReader Create a new instance of Parser (using your own Converter or not).
getCipher Create a new instance of Crypto.
getCompacter Create a new instance of Compressor.

Serializer

Method Description
write Write a Type-Length-Value for the given type and value..
serialize ..and store them as 1, 2 or 4-bytes.

Parser

Method Description
read Read the Type-Length-Value bytes..
parse ..and extract value (for the given 1, 2 or 4-bytes type).

Crypto

Method Description
add Add bytes.
encrypt Encrypt the byte array with AES-128.
decrypt Decrypt the byte array.

Compressor

Method Description
add Add bytes.
deflate Compress the byte array with DEFLATE.
inflate Decompress the byte array.

Converter

Method Description
convertToInt Convert byte array to integer.
convertToBytes Convert short or integer to byte array.