kotlinx-io icon indicating copy to clipboard operation
kotlinx-io copied to clipboard

Avoid buffered source/sink creation when RawSource::buffered/RawSink::buffered invoked on Source/Sink

Open fzhinkin opened this issue 2 years ago • 0 comments
trafficstars

Currently, RawSource::buffered/RawSink::buffered always create a new Source/Sink even when invoked on Source/Sink instance. It's convenient for testing, and there are arguments why doing it differently may cause issues (https://github.com/Kotlin/kotlinx-io/pull/136#issuecomment-1604125718).

However, it may be worth adding a separate set of extensions (or adding a parameter to RawSink::buffered/RawSource::buffered) allowing to bypass of a new buffered source/sink creation for buffered invoked on Source/Sink.

fzhinkin avatar Jun 23 '23 11:06 fzhinkin