Jruby 1.7.6 and 1.7.8 at least have a problem with RubyFile.size on windows corrupting the underlying file handle. Calling "RubyFile.stat.size" avoids this issue