oscerd commented on code in PR #26495:
URL: https://github.com/apache/camel/pull/26495#discussion_r4034146076
##########
components/camel-huawei/camel-huaweicloud-obs/src/main/java/org/apache/camel/component/huaweicloud/obs/OBSProducer.java:
##########
@@ -153,7 +159,7 @@ private void putObject(Exchange exchange,
ClientConfigurations clientConfigurati
} else if (body instanceof String) {
// the string content will be stored in the remote object
LOG.trace("Writing text body into an object");
- InputStream stream = new ByteArrayInputStream(((String)
body).getBytes());
+ InputStream stream = new ByteArrayInputStream(((String)
body).getBytes(StandardCharsets.UTF_8));
putObjectResult =
obsClient.putObject(clientConfigurations.getBucketName(),
clientConfigurations.getObjectName(), stream);
stream.close();
Review Comment:
Done in the follow-up commit — the ByteArrayInputStream is now in
try-with-resources for consistency with the OBSUtils download path. As you
noted its close() is a no-op, so there is no behavioural change.
_Claude Code on behalf of oscerd_
--
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]