Hey there! Does anyone know how to read a
ByteReadChannel
twice? The idea is that the server returns a stream, the client exposes it as a
ByteReadChannel
so it can be consumed by the media player right away (streaming) and we'd like to reuse the channel to copy the stream into a file after the playback (to avoid the need of re-requesting the backend), but debugging the code after the media player is done,
byteReadChannel.isClosedForRead
is
true
so can't be "reused" to copy into a file, we understand that
ByteReadChannel
is single-reader so any ideas as to how we can stream to the media player immediately and then reuse the response somehow to copy it to a file after the player finishes? Thanks in advance!
Cc
@Aleksei Tirman [JB]