Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
proton-j-0.25.0
-
None
Description
In some cases the read-only output buffer exposed by TransportImpl by calling head() or getOutputBuffer() can lead to extra intermediate copies of the buffer based on the IO framework being used to transmit the bytes (such as current Netty releases). This is due to the fact that the read-only buffer reports that it doesn't have a backing array so the frameworks try to work around this to optimize the transfer of bytes. For uses who are aware of this and can ensure they never tamper with the buffer contents that aren't consumed we should let them choose to expose a writable duplicate of the output buffer.