steal segmentedstringwriter from jackson