adding encoding excpetion in Headlength codec when Header field is not set