Skip to content

use ByteString asByteBuffer#2840

Closed
pjfanning wants to merge 5 commits intoapache:mainfrom
pjfanning:bytebuffer
Closed

use ByteString asByteBuffer#2840
pjfanning wants to merge 5 commits intoapache:mainfrom
pjfanning:bytebuffer

Conversation

@pjfanning
Copy link
Copy Markdown
Member

  • avoids 'unsafe' array code
  • The ByteBuffer returned directly wraps the bytes in the ByteString (unless the ByteString is a concat of other ByteStrings) - so we don't need to create a new byte array in most cases

@pjfanning
Copy link
Copy Markdown
Member Author

I'm to close this because the current code seems to work and this change might be a little safer, it might be slower in most cases.

@pjfanning pjfanning closed this Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant