TLV builder and parser