mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 14:50:55 +03:00
s3: implement multipart downloads without using the S3 Manager
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -1282,6 +1282,18 @@ func readFill(r io.Reader, buf []byte) (n int, err error) {
|
||||
return n, err
|
||||
}
|
||||
|
||||
func writeAtFull(w io.WriterAt, buf []byte, offset int64, count int) (int, error) {
|
||||
written := 0
|
||||
for written < count {
|
||||
n, err := w.WriteAt(buf[written:count], offset+int64(written))
|
||||
written += n
|
||||
if err != nil {
|
||||
return written, err
|
||||
}
|
||||
}
|
||||
return written, nil
|
||||
}
|
||||
|
||||
type bytesReaderWrapper struct {
|
||||
*bytes.Reader
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user