Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing API: Sink.write(CharSequence) #261

Closed
joffrey-bion opened this issue Feb 14, 2024 · 0 comments · Fixed by #318
Closed

Missing API: Sink.write(CharSequence) #261

joffrey-bion opened this issue Feb 14, 2024 · 0 comments · Fixed by #318

Comments

@joffrey-bion
Copy link

joffrey-bion commented Feb 14, 2024

At the moment, when receiving data from a mutable CharSequence, one has to use sink.writeString(chars.toString()), which may be inefficient (copying data to create a String, just to then encode it again as UTF-8 bytes in the buffer).

It would be nice to have a Sink.write(CharSequence) (or Sink.writeUtf8(CharSequence)) extension so we can efficiently transfer characters from a CharSequence into a Buffer via UTF-8 encoding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants