aaron-ai commented on issue #262: URL: https://github.com/apache/rocketmq-clients/issues/262#issuecomment-1281913560
The underlying byte array of `bytebuffer` is readonly, which means you could not get it directly, so copy it from `bytebuffer` rather than get it directly if you need `byte[]`. ```java byte[] bytes = new byte[body.remaining()]; body.get(bytes); ``` or you could easily get `String` type according to your type. ```java // Replace by your charset final String body = StandardCharsets.UTF_8.decode(messageView.getBody()).toString(); ``` -- 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]
