i guess this is more compatible; for ruby 1.9.3 and jruby
jruby copy_stream fallback