Closed Jacalz closed 3 years ago
The size of the file is sent to the receiver as part of the initial metadata (its how the receiver is able to show an accurate progress bar). A Seeker is a natural way to determine that information when you are dealing with files on disk.
If your application has a different mechanism for determining the size of the file you could use something like https://godoc.org/go4.org/readerutil#NewFakeSeeker.
Thanks for the explanation. I see that now. There are probably more issues to consider for mobile versions, probably keeping it from making sense any time in the near future. Closing...
Hi there. I am wondering if the need for supplying an
io.ReadSeeker
possibly could be changed to using a regulario.Reader
?The question comes from work on wormhole-gui where I would like to try and get it to work on iOS and Android. Getting it working would currently result in a lot of platform specific code for getting a seeker working or might even be impossible when working through the limited APIs exposed by Apple.
It looks like there isn't a massive amount of code relying on it (see search results) and hopefully those size calculations could be done in a different maner. Just using
ìo.Reader
would make things much better for mobile and wouldn't cause any API breakages as anyìo.ReadSeeker
already complies withìo.Reader
.