I like everything except this line.

It doesn't look like the PipedInputStream is referenced anywhere but this line.  How about adding a boolean field on the response (defaulting to ```false```), use that field in the if statement and your server then calls ```setChunked(true)``` to accomplish the same thing?