studio-b12 / gowebdav

A golang WebDAV client library and command line tool.
BSD 3-Clause "New" or "Revised" License
309 stars 89 forks source link

added ReadStreamRange() method to efficiently read a range of data #46

Closed jkowalski closed 2 years ago

jkowalski commented 2 years ago

It passes "Range: bytes=X-Y" and if the server returns HTTP 206, we know it complied with the request.

For servers that don't understand range and return HTTP 200 instead we discard some bytes and limit the result to emulate this behavior.

This will greatly help https://github.com/kopia/kopia which relies on partial reads from pack blobs.

Fixes #23

chripo commented 2 years ago

thank you!