s/OutputStream/Writer/ as pointed out by Jesse.

Reference: https://github.com/jenkinsci/remoting/commit/cdbc40b8980d3ea528473daf7e44475c956a9a03#commitcomment-5870985
Added a test case for the previous commit