Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #3369: fix three defects in javalib FileChannel write methods #3370

Conversation

LeeTibbert
Copy link
Contributor

Fix #3369

Three defects are removed from javalib FileChannel write methods.

The Java API write(srcs, offset, length) method now returns the number
of 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 accurate
count of bytes written for both partial and complete writes.

Argument checking is also implemented in several places.

@LeeTibbert LeeTibbert added component:javalib backport candidate PR which might be backported into previous major release of SN labels Jul 4, 2023
@WojciechMazur WojciechMazur merged commit 3bcc03e into scala-native:main Jul 4, 2023
77 checks passed
WojciechMazur pushed a commit to WojciechMazur/scala-native that referenced this pull request Sep 1, 2023
WojciechMazur pushed a commit that referenced this pull request Sep 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport candidate PR which might be backported into previous major release of SN component:javalib
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Three defects in javalib FileChannelImpl write methods
2 participants