1.Add support total length config by AUTO,BODY,HEAD_BODY
2.Fix verify problem when total length changed.
3.Add final encode API.
4.Add test code.