add methods

add methods to enc/dec any obj