Hi! I am using Okio on a project where I need to i...
# io
d
Hi! I am using Okio on a project where I need to index a file. I was naively looking for a
BufferedSource
property that tells me how many bytes I have already read. It seems there is no direct mean to do that. I have routines that read individual packets from a
BufferedSource
. How would you proceed?
m
Wrap your
BufferedSource
into another one that delegates to it and increments a byte counter?
d
@mbonnin yeah, this was my initial though but unfortunately
BufferedSource
is a sealed interface.
Does anyone see another way to proceed than to wrap
BufferedSource
? @jw Would you consider this a sufficient use-case to unseal the
BufferedSource
interface? Or maybe should I contribute an
OffsetCountingSource
directly to
okio
? (PS: I see that
Source
from
kotlinx-io
is also sealed.)