impl header decode/encode