square / okio

A modern I/O library for Android, Java, and Kotlin Multiplatform.
https://square.github.io/okio/
Apache License 2.0
8.72k stars 1.17k forks source link

Integration with kotlin.text.Appendable #1441

Open saket opened 4 months ago

saket commented 4 months ago

Should okio offer an BufferedSink -> Appendable adapter for use with kotlinpoet and other libraries that do not accept output streams?

fileSystem.write(path) {
  // Along the lines of BufferedSink#outputStream().
  fileSpec.writeTo(this.appendable())
}
JakeWharton commented 3 weeks ago

It would probably have to be utf8Appendable(), or on the JVM we could also do appendable(Charset).