Permalink
Browse files

Increment from io position by transfer size

  • Loading branch information...
1 parent bfdbc34 commit 6d6f027a3295f654f7c5581d11c05b1a0fc4bfd3 @atambo atambo committed Dec 30, 2012
Showing with 1 addition and 1 deletion.
  1. +0 −1 spec/tags/1.9/ruby/core/io/copy_stream_tags.txt
  2. +1 −0 src/org/jruby/RubyIO.java
@@ -1,5 +1,4 @@
fails:IO.copy_stream from an IO does not change the IO offset when an offset is specified
-fails:IO.copy_stream from an IO does change the IO offset when an offset is not specified
fails:IO.copy_stream from an IO to a file name copies only length bytes when specified
fails:IO.copy_stream from an IO to a file name copies only length bytes from the offset
fails:IO.copy_stream from an IO to an IO starts writing at the destination IO's current position
@@ -4189,6 +4189,7 @@ public static IRubyObject copy_stream(ThreadContext context, IRubyObject recv,
WritableByteChannel to = (WritableByteChannel)d2.getChannel();
size = transfer(from, to);
+ from.position(from.position() + size);
}
return context.runtime.newFixnum(size);

0 comments on commit 6d6f027

Please sign in to comment.