You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Buffer expansions in Output's ByteArrayOutputStream duplicate content, and then that array is duplicated again with #toByteArray(). I have been working on a PR to try to use a single array, but would want to refactor Request.Body in the core project to use a wrapper (probably java.nio.ByteBuffer). This would allow to use a buffer that might be longer than the actual content, on the thinking that it's more efficient to use CharsetEncoder#maxBytesPerChar() than to actually encode a given String twice, and that an array slightly longer than needed is still better than two arrays of the proper length. It should be possible to maintain backward compatibility of the API, but since this would require coordination across repositories I thought best to open a PR to begin with.
The text was updated successfully, but these errors were encountered:
Buffer expansions in
Output
'sByteArrayOutputStream
duplicate content, and then that array is duplicated again with#toByteArray()
. I have been working on a PR to try to use a single array, but would want to refactorRequest.Body
in the core project to use a wrapper (probablyjava.nio.ByteBuffer
). This would allow to use a buffer that might be longer than the actual content, on the thinking that it's more efficient to useCharsetEncoder#maxBytesPerChar()
than to actually encode a givenString
twice, and that an array slightly longer than needed is still better than two arrays of the proper length. It should be possible to maintain backward compatibility of the API, but since this would require coordination across repositories I thought best to open a PR to begin with.The text was updated successfully, but these errors were encountered: