Fix #3369: fix three defects in javalib FileChannel write methods #3370
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #3369
Three defects are removed from javalib
FileChannel
write methods.The Java API
write(srcs, offset, length)
method now returns the numberof bytes successfully written. This matches its JVM description. On unix-like,
this number may be less that the number of bytes requested to be written,
The srcs buffers are left in a state that allows easier retry: i.e. position is
set < limit on partial writes.
The prior Windows code appears to throw an exception on partial writes. This is
left unchanged.
unix-like systems can and do return partial writes on occasion. Two internal routines
were fixed so that the corresponding Java API
write()
methods return an accuratecount of bytes written for both partial and complete writes.
Argument checking is also implemented in several places.