nkuprins opened a new pull request, #963: URL: https://github.com/apache/fesod/pull/963
## Purpose of the pull request Closed: #952 ## What's changed? `IoUtils.toByteArray(InputStream)` had a `finally` block calling `output.toByteArray()` and discarding the result. `ByteArrayOutputStream.toByteArray()` allocates a full copy of the internal buffer, so every call allocated the payload twice - a leftover from translating commons-io's try-with-resources version, where the `finally` would have been `output.close()` (a no-op for `ByteArrayOutputStream`). This removes the `try`/`finally` entirely. ### Testing No behaviour change. Existing `IoUtilsTest` (7 cases) passes unchanged. ## Checklist - [x] I have read the [Contributor Guide](https://fesod.apache.org/community/contribution/). - [ ] I have written the necessary doc or comment. - [x] I have added the necessary unit tests and all cases have passed. -- 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]
