tabish121 commented on PR #1284:
URL: https://github.com/apache/activemq/pull/1284#issuecomment-2311222596

   > @azotcsit - Here is the link to the protonj code where they have a custom 
impl 
https://github.com/apache/qpid-proton-j/blob/main/proton-j/src/main/java/org/apache/qpid/proton/codec/WritableBuffer.java
   > 
   > I think the idea is you don't know the length using the built in JDK 
version so this gets the length to allocate the buffer size first. I believe 
protonj uses the JDK though for decoding even if using a custom impl for 
encoding.
   > 
   > @tabish121 - does that sound right?
   
   Sounds right, the codec doesn't want to incur overhead of writing into 
buffers and later copying them into the resulting output buffer so it does the 
encode itself directly, but uses the JDK to decode the string by providing a 
slice that provides the limit to the JDK on which bytes comprise the encoded 
string.


-- 
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: gitbox-unsubscr...@activemq.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@activemq.apache.org
For additional commands, e-mail: gitbox-h...@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact


Reply via email to