-
Bug
-
Resolution: Fixed
-
P4
-
8, 11, 17, 21
-
b21
-
Verified
Spotted during code review; no known impact.
StreamEncoder.writeBytes assumes (and asserts) that all bytes will be written to the target channel in a single invocation of write. If a channel only consumes a part of the provided ByteBuffer, any excess is lost.
The attached test creates a writer on a channel that only consumes one byte at a time from the passed ByteBuffer. It should eventually consume all characters. Instead it either loses characters, or asserts if system assertions are enabled.
StreamEncoder.writeBytes assumes (and asserts) that all bytes will be written to the target channel in a single invocation of write. If a channel only consumes a part of the provided ByteBuffer, any excess is lost.
The attached test creates a writer on a channel that only consumes one byte at a time from the passed ByteBuffer. It should eventually consume all characters. Instead it either loses characters, or asserts if system assertions are enabled.
- relates to
-
JDK-8318677 (ch) Add implNote about minBufferCap to main variant of Channels.newWriter
- Resolved
-
JDK-8316391 (zipfs) ZipFileSystem.readFullyAt does not tolerate short reads
- Resolved