do not count the unknown length in the written count (safety first)
Merge pull request #194 from robUx4/safe_unknown_size

do not count the unknown length in the written count