Use loops for arrays in encode/decode.