write the length of encoded string