add interface encode/decode in w/r