use long.Parse when setting content length

int.Parse fails on values greater than int.MaxValue