]> git.proxmox.com Git - proxmox-backup.git/blobdiff - src/backup/chunk_stream.rs
src/backup/chunk_stream.rs: add optional chunk_size parameter
[proxmox-backup.git] / src / backup / chunk_stream.rs
index fb11ac8d2efc7aae56c398bf841423694be34ea4..a8a77e091ec4796a19a76a7c7ef2d2366867b79f 100644 (file)
@@ -15,8 +15,8 @@ pub struct ChunkStream<S> {
 }
 
 impl <S> ChunkStream<S> {
-    pub fn new(input: S) -> Self {
-        Self { input, chunker: Chunker::new(4 * 1024 * 1024), buffer: BytesMut::new(), scan_pos: 0}
+    pub fn new(input: S, chunk_size: Option<usize>) -> Self {
+        Self { input, chunker: Chunker::new(chunk_size.unwrap_or(4*1024*1024)), buffer: BytesMut::new(), scan_pos: 0}
     }
 }