src/backup/chunk_stream.rs: add optional chunk_size parameter

This commit is contained in:
Dietmar Maurer
2019-05-30 13:28:24 +02:00
parent 49ef316bcd
commit 36898ffce6
5 changed files with 11 additions and 15 deletions

View 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}
}
}