Skip to content

Missing API: Sink.write(CharSequence) #261

Closed
@joffrey-bion

Description

@joffrey-bion

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions