siddiqueirshad opened a new pull request, #16556: URL: https://github.com/apache/dubbo/pull/16556
### Description According to the \InputStream.read(byte[], int, int)\ contract, if \len\ is zero, 0 should be returned without modifying destination buffers or advancing position, even when the stream is exhausted or empty. Previously, the EOF check ran before the zero-length check in \UnsafeByteArrayInputStream.read(byte[], int, int)\, causing \ ead(b, off, 0)\ and \ ead(new byte[0])\ to return -1 at EOF. This PR: - Handles \len == 0\ after argument validation and before the EOF check. - Adds unit tests in \UnsafeByteArrayInputStreamTest\ covering zero-length reads on empty and exhausted streams. Fixes #16554 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
