### Install qbsdiff command-line tool Source: https://github.com/hucsmn/qbsdiff/blob/master/README.md Install the qbsdiff command-line tool globally to your Cargo bin directory for easy access. ```shell $ cargo install qbsdiff --features cmd ``` -------------------------------- ### Bspatch::hint_target_size - Get Expected Target Size Source: https://context7.com/hucsmn/qbsdiff/llms.txt Returns the expected size of the target file after applying the patch. Useful for preallocating output buffers or files. ```APIDOC ## Bspatch::hint_target_size - Get Expected Target Size ### Description Returns the expected size of the target file after applying the patch. Useful for preallocating output buffers or files. ### Method `Bspatch::hint_target_size` ### Endpoint N/A (Struct method) ### Response #### Success Response (usize) - **target_size** (usize) - The expected size of the target file in bytes. ### Request Example ```rust use std::io; use std::fs::File; use qbsdiff::Bspatch; fn apply_patch_to_file(source: &[u8], patch: &[u8], output_path: &str) -> io::Result { let patcher = Bspatch::new(patch)?; // Get expected size for preallocation let target_size = patcher.hint_target_size(); println!("Target will be {} bytes", target_size); // Create output file and apply patch let mut target_file = File::create(output_path)?; patcher.apply(source, &mut target_file) } ``` ``` -------------------------------- ### Bspatch::hint_target_size - Get Expected Target Size Source: https://context7.com/hucsmn/qbsdiff/llms.txt Returns the expected size of the target file after applying the patch. Useful for preallocating output buffers or files. ```rust use std::io; use std::fs::File; use qbsdiff::Bspatch; fn apply_patch_to_file(source: &[u8], patch: &[u8], output_path: &str) -> io::Result { let patcher = Bspatch::new(patch)?; // Get expected size for preallocation let target_size = patcher.hint_target_size(); println!("Target will be {} bytes", target_size); // Create output file and apply patch let mut target_file = File::create(output_path)?; patcher.apply(source, &mut target_file) } ``` -------------------------------- ### Apply large patch using memory mapping Source: https://context7.com/hucsmn/qbsdiff/llms.txt Applies a patch to a large source file by memory-mapping it for efficient access. This example falls back to reading the entire file into memory if memory mapping is not available. ```rust use std::io; use std::fs::File; use qbsdiff::Bspatch; // use memmap2::Mmap; // Add memmap2 to dependencies fn apply_large_patch(source_path: &str, patch_path: &str, target_path: &str) -> io::Result { // Memory-map the source file for efficient random access let source_file = File::open(source_path)?; // let source = unsafe { Mmap::map(&source_file)? }; let source = std::fs::read(source_path)?; // Fallback for this example let patch = std::fs::read(patch_path)?; let patcher = Bspatch::new(&patch)?; let mut target_file = File::create(target_path)?; // Apply with optimized buffer for file I/O patcher .buffer_size(131072) // 128 KiB for unbuffered file writes .apply(&source, &mut target_file) } ``` -------------------------------- ### Complete Diff and Patch Workflow Source: https://context7.com/hucsmn/qbsdiff/llms.txt Demonstrates a complete workflow for creating a patch between two binary files and then applying it to verify the reconstruction. Includes parallel processing and compression level configuration. ```rust use std::io; use qbsdiff::{Bsdiff, Bspatch, ParallelScheme}; fn main() -> io::Result<()> { // Original and modified binary data let source = b"Hello, this is the original file content!"; let target = b"Hello, this is the modified file content with changes!"; // Step 1: Create a patch let mut patch = Vec::new(); let patch_size = Bsdiff::new(source, target) .parallel_scheme(ParallelScheme::Auto) .compression_level(6) .compare(io::Cursor::new(&mut patch))?; println!("Source size: {} bytes", source.len()); println!("Target size: {} bytes", target.len()); println!("Patch size: {} bytes", patch_size); // Step 2: Apply the patch to reconstruct target let patcher = Bspatch::new(&patch)?; let mut reconstructed = Vec::with_capacity(patcher.hint_target_size() as usize); patcher.apply(source, io::Cursor::new(&mut reconstructed))?; // Step 3: Verify reconstruction assert_eq!(&reconstructed, target); println!("Reconstruction verified successfully!"); Ok(()) } // Output: // Source size: 42 bytes // Target size: 55 bytes // Patch size: 78 bytes // Reconstruction verified successfully! ``` -------------------------------- ### Build qbsdiff and qbspatch commands Source: https://github.com/hucsmn/qbsdiff/blob/master/README.md Compile the qbsdiff and qbspatch command-line executables using Cargo. The --features cmd flag is required to enable the command-line tools. ```shell $ cargo build --release --bins --features cmd $ cd target/release $ ./qbsdiff --help $ ./qbspatch --help ``` -------------------------------- ### Command-Line Tools - Create Patch Source: https://context7.com/hucsmn/qbsdiff/llms.txt Creates a patch file between two binary files using the `qbsdiff` command-line tool. Supports custom compression levels and buffer sizes. ```bash # Create a patch between source and target files qbsdiff old_version.bin new_version.bin update.patch # Create patch with custom settings qbsdiff -z 1 -b 65536 old.bin new.bin patch.bin # Fast compression, 64KB buffer # Disable parallel processing qbsdiff -P old.bin new.bin patch.bin # Set parallel chunk size (minimum 256 KiB) qbsdiff -c 1048576 old.bin new.bin patch.bin # 1 MiB chunks ``` -------------------------------- ### Command-Line Tools - Apply Patch Source: https://context7.com/hucsmn/qbsdiff/llms.txt Applies a bsdiff patch file to reconstruct the target binary from the source data using the `qbspatch` command-line tool. ```bash # Apply a patch to reconstruct the target qbspatch old_version.bin new_version.bin update.patch ``` -------------------------------- ### Complete Diff and Patch Workflow Source: https://context7.com/hucsmn/qbsdiff/llms.txt Demonstrates a complete workflow for creating a patch between two binary files and then applying it to verify the reconstruction. ```APIDOC ## Complete Diff and Patch Workflow ### Description This example demonstrates a complete workflow for creating a patch between two binary files and then applying it to verify the reconstruction. ### Steps 1. **Create Patch**: Use `Bsdiff` to generate a patch file from source and target data. 2. **Apply Patch**: Use `Bspatch` to apply the generated patch to the source data. 3. **Verify Reconstruction**: Assert that the reconstructed data matches the original target data. ### Request Example ```rust use std::io; use qbsdiff::{Bsdiff, Bspatch, ParallelScheme}; fn main() -> io::Result<()> { // Original and modified binary data let source = b"Hello, this is the original file content!"; let target = b"Hello, this is the modified file content with changes!"; // Step 1: Create a patch let mut patch = Vec::new(); let patch_size = Bsdiff::new(source, target) .parallel_scheme(ParallelScheme::Auto) .compression_level(6) .compare(io::Cursor::new(&mut patch))?; println!("Source size: {} bytes", source.len()); println!("Target size: {} bytes", target.len()); println!("Patch size: {} bytes", patch_size); // Step 2: Apply the patch to reconstruct target let patcher = Bspatch::new(&patch)?; let mut reconstructed = Vec::with_capacity(patcher.hint_target_size() as usize); patcher.apply(source, io::Cursor::new(&mut reconstructed))?; // Step 3: Verify reconstruction assert_eq!(&reconstructed, target); println!("Reconstruction verified successfully!"); Ok(()) } // Output: // Source size: 42 bytes // Target size: 55 bytes // Patch size: 78 bytes // Reconstruction verified successfully! ``` ``` -------------------------------- ### Add qbsdiff to Cargo.toml Source: https://github.com/hucsmn/qbsdiff/blob/master/README.md Add the qbsdiff crate to your project's dependencies by including this line in your Cargo.toml file. ```toml [dependencies] qbsdiff = "1.4" ``` -------------------------------- ### Use stdin/stdout for patching Source: https://context7.com/hucsmn/qbsdiff/llms.txt Applies a patch using standard input and output streams. Use '-' to represent stdin/stdout. ```bash cat old.bin | qbsdiff - new.bin patch.bin ``` ```bash qbspatch old.bin - patch.bin > new.bin ``` -------------------------------- ### Generate patch data by comparing source and target Source: https://github.com/hucsmn/qbsdiff/blob/master/README.md Use the Bsdiff::new function to initialize a comparison between source and target data, then use the compare method to write the generated patch data to an IO writer. The resulting patch file format is compatible with bsdiff 4.x. ```rust use std::io; use qbsdiff::Bsdiff; fn bsdiff(source: &[u8], target: &[u8]) -> io::Result> { let mut patch = Vec::new(); Bsdiff::new(source, target) .compare(io::Cursor::new(&mut patch))?; Ok(patch) } ``` -------------------------------- ### Command-Line Tools Source: https://context7.com/hucsmn/qbsdiff/llms.txt The library includes two command-line utilities when built with the `cmd` feature, for creating and applying patches. ```APIDOC ## Command-Line Tools ### Description The library includes two command-line utilities when built with the `cmd` feature. ### Installation ```bash # Build the command-line tools cargo build --release --bins --features cmd # Or install globally cargo install qbsdiff --features cmd ``` ### Usage #### Creating a Patch ```bash # Create a patch between source and target files qbsdiff old_version.bin new_version.bin update.patch # Create patch with custom settings (fast compression, 64KB buffer) qbsdiff -z 1 -b 65536 old.bin new.bin patch.bin # Disable parallel processing qbsdiff -P old.bin new.bin patch.bin # Set parallel chunk size (minimum 256 KiB) qbsdiff -c 1048576 old.bin new.bin patch.bin # 1 MiB chunks ``` #### Applying a Patch ```bash # Apply a patch to reconstruct the target qbspatch old_version.bin new_version.bin update.patch ``` ``` -------------------------------- ### Apply a patch to source data Source: https://github.com/hucsmn/qbsdiff/blob/master/README.md Use the Bspatch::new function to create a patcher from patch data, then apply it to the source data to produce the target stream. The target vector can be pre-allocated using the hint_target_size method. ```rust use std::io; use qbsdiff::Bspatch; fn bspatch(source: &[u8], patch: &[u8]) -> io::Result> { let patcher = Bspatch::new(patch)?; let mut target = Vec::new(); // To preallocate target: //Vec::with_capacity(patcher.hint_target_size() as usize); patcher.apply(source, io::Cursor::new(&mut target)?); Ok(target) } ``` -------------------------------- ### Create Binary Delta Patch with Bsdiff Source: https://context7.com/hucsmn/qbsdiff/llms.txt Creates a bsdiff 4.x compatible patch file by comparing source and target binary data. Requires loading source and target files and writing the resulting patch to a file. Uses default settings with parallel processing enabled. ```rust use std::io; use std::fs; use qbsdiff::{Bsdiff, ParallelScheme}; fn main() -> io::Result<()> { // Load source and target files let source = fs::read("old_version.bin")?; let target = fs::read("new_version.bin")?; // Create patch with default settings (parallel processing enabled) let mut patch = Vec::new(); let patch_size = Bsdiff::new(&source, &target) .compare(io::Cursor::new(&mut patch))?; fs::write("update.patch", &patch)?; println!("Created patch: {} bytes", patch_size); // Output: Created patch: 1234 bytes Ok(()) } ``` -------------------------------- ### Apply patch with custom buffer size Source: https://context7.com/hucsmn/qbsdiff/llms.txt Applies a patch to a file using a specified buffer size. ```bash qbspatch -b 4096 old.bin new.bin patch.bin ``` -------------------------------- ### Bsdiff - Create Binary Delta Patches Source: https://context7.com/hucsmn/qbsdiff/llms.txt The Bsdiff struct provides a builder-pattern API for configuring and executing delta compression between source and target binary data. It compares the two inputs and generates a bsdiff 4.x compatible patch file. ```APIDOC ## Bsdiff - Create Binary Delta Patches ### Description Compares source and target binary data to generate a bsdiff 4.x compatible patch file. ### Method POST (Conceptual - This is a library function, not a direct HTTP endpoint) ### Endpoint N/A (Library function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None (Operates on byte slices) ### Request Example ```rust use std::io; use std::fs; use qbsdiff::{Bsdiff, ParallelScheme}; fn main() -> io::Result<()> { let source = fs::read("old_version.bin")?; let target = fs::read("new_version.bin")?; let mut patch = Vec::new(); let patch_size = Bsdiff::new(&source, &target) .compare(io::Cursor::new(&mut patch))?; fs::write("update.patch", &patch)?; println!("Created patch: {} bytes", patch_size); Ok(()) } ``` ### Response #### Success Response (200) None (Returns the size of the generated patch in bytes) #### Response Example ``` Created patch: 1234 bytes ``` ``` -------------------------------- ### Configure Parallel Processing for Bsdiff Source: https://context7.com/hucsmn/qbsdiff/llms.txt Configures how the delta compression algorithm parallelizes work across multiple CPU cores. Options include `Never` for single-threaded, `Auto` for automatic configuration, `ChunkSize(usize)` for fixed chunk size, and `NumJobs(usize)` for maximum parallel jobs. ```rust use std::io; use qbsdiff::{Bsdiff, ParallelScheme}; fn create_patch_single_threaded(source: &[u8], target: &[u8]) -> io::Result> { let mut patch = Vec::new(); Bsdiff::new(source, target) .parallel_scheme(ParallelScheme::Never) .compare(io::Cursor::new(&mut patch))?; Ok(patch) } ``` ```rust use std::io; use qbsdiff::{Bsdiff, ParallelScheme}; fn create_patch_with_chunk_size(source: &[u8], target: &[u8]) -> io::Result> { let mut patch = Vec::new(); // Each parallel job processes chunks of 1 MiB (minimum 256 KiB enforced) Bsdiff::new(source, target) .parallel_scheme(ParallelScheme::ChunkSize(1024 * 1024)) .compare(io::Cursor::new(&mut patch))?; Ok(patch) } ``` ```rust use std::io; use qbsdiff::{Bsdiff, ParallelScheme}; fn create_patch_with_job_limit(source: &[u8], target: &[u8]) -> io::Result> { let mut patch = Vec::new(); // Limit to 4 parallel jobs Bsdiff::new(source, target) .parallel_scheme(ParallelScheme::NumJobs(4)) .compare(io::Cursor::new(&mut patch))?; Ok(patch) } ``` -------------------------------- ### Set bzip2 Compression Level for Patch Source: https://context7.com/hucsmn/qbsdiff/llms.txt Sets the bzip2 compression level for the patch file output, ranging from 0 (no compression) to 9 (maximum compression). Level 1 is the fastest, while level 6 is the default. ```rust use std::io; use qbsdiff::Bsdiff; fn create_fast_patch(source: &[u8], target: &[u8]) -> io::Result> { let mut patch = Vec::new(); Bsdiff::new(source, target) .compression_level(1) // Fastest compression .compare(io::Cursor::new(&mut patch))?; Ok(patch) } ``` ```rust use std::io; use qbsdiff::Bsdiff; fn create_maximum_compression_patch(source: &[u8], target: &[u8]) -> io::Result> { let mut patch = Vec::new(); Bsdiff::new(source, target) .compression_level(9) // Maximum compression (may be slower) .compare(io::Cursor::new(&mut patch))?; Ok(patch) } ``` -------------------------------- ### Bspatch - Apply Binary Delta Patches Source: https://context7.com/hucsmn/qbsdiff/llms.txt The `Bspatch` struct parses and applies bsdiff 4.x format patch files to reconstruct the target binary from source data. It provides configuration options for buffer sizes to optimize memory usage and performance. ```APIDOC ## Bspatch - Apply Binary Delta Patches ### Description The `Bspatch` struct parses and applies bsdiff 4.x format patch files to reconstruct the target binary from source data. It provides configuration options for buffer sizes to optimize memory usage and performance. ### Method `Bspatch::new` ### Endpoint N/A (Struct method) ### Parameters #### Path Parameters - **patch** (&[u8]) - Required - The binary patch data. ### Request Example ```rust use std::io; use std::fs; use qbsdiff::Bspatch; fn main() -> io::Result<()> { // Load source file and patch let source = fs::read("old_version.bin")?; let patch = fs::read("update.patch")?; // Create patcher and apply let patcher = Bspatch::new(&patch)?; // Check expected target size for preallocation println!("Expected target size: {} bytes", patcher.hint_target_size()); let mut target = Vec::with_capacity(patcher.hint_target_size() as usize); let written = patcher.apply(&source, io::Cursor::new(&mut target))?; fs::write("new_version.bin", &target)?; println!("Reconstructed target: {} bytes", written); // Output: Reconstructed target: 5678 bytes Ok(()) } ``` ``` -------------------------------- ### Bspatch - Apply Binary Delta Patches Source: https://context7.com/hucsmn/qbsdiff/llms.txt Parses and applies bsdiff 4.x format patch files to reconstruct the target binary from source data. It provides configuration options for buffer sizes to optimize memory usage and performance. ```rust use std::io; use std::fs; use qbsdiff::Bspatch; fn main() -> io::Result<()> { // Load source file and patch let source = fs::read("old_version.bin")?; let patch = fs::read("update.patch")?; // Create patcher and apply let patcher = Bspatch::new(&patch)?; // Check expected target size for preallocation println!("Expected target size: {} bytes", patcher.hint_target_size()); let mut target = Vec::with_capacity(patcher.hint_target_size() as usize); let written = patcher.apply(&source, io::Cursor::new(&mut target))?; fs::write("new_version.bin", &target)?; println!("Reconstructed target: {} bytes", written); // Output: Reconstructed target: 5678 bytes Ok(()) } ``` -------------------------------- ### Bsdiff::parallel_scheme - Configure Parallel Processing Source: https://context7.com/hucsmn/qbsdiff/llms.txt Controls how the delta compression algorithm parallelizes work across multiple CPU cores. Options include Never (single-threaded), Auto (automatic configuration), ChunkSize(usize) (fixed chunk size per thread), and NumJobs(usize) (maximum number of parallel jobs). ```APIDOC ## Bsdiff::parallel_scheme - Configure Parallel Processing ### Description Configures the parallel processing strategy for delta compression. ### Method POST (Conceptual - This is a library function, not a direct HTTP endpoint) ### Endpoint N/A (Library function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None (Operates on byte slices) ### Request Example ```rust use std::io; use qbsdiff::{Bsdiff, ParallelScheme}; // Single-threaded let mut patch_single = Vec::new(); Bsdiff::new(source, target) .parallel_scheme(ParallelScheme::Never) .compare(io::Cursor::new(&mut patch_single))?; // With chunk size (1 MiB) let mut patch_chunk = Vec::new(); Bsdiff::new(source, target) .parallel_scheme(ParallelScheme::ChunkSize(1024 * 1024)) .compare(io::Cursor::new(&mut patch_chunk))?; // With job limit (4 jobs) let mut patch_jobs = Vec::new(); Bsdiff::new(source, target) .parallel_scheme(ParallelScheme::NumJobs(4)) .compare(io::Cursor::new(&mut patch_jobs))?; ``` ### Response #### Success Response (200) None (Returns the size of the generated patch in bytes) #### Response Example None (Function returns io::Result<()>) ``` -------------------------------- ### Configure Delta Calculation Buffer Size Source: https://context7.com/hucsmn/qbsdiff/llms.txt Sets the buffer size used during delta calculation. Larger buffers may improve performance for large files. The minimum buffer size is 128 bytes. ```rust use std::io; use qbsdiff::{Bsdiff, ParallelScheme}; fn create_memory_efficient_patch(source: &[u8], target: &[u8]) -> io::Result> { let mut patch = Vec::new(); Bsdiff::new(source, target) .buffer_size(65536) // 64 KiB buffer .compression_level(1) .parallel_scheme(ParallelScheme::Never) .compare(io::Cursor::new(&mut patch))?; Ok(patch) } ``` -------------------------------- ### Bsdiff::small_match - Configure Match Threshold Source: https://context7.com/hucsmn/qbsdiff/llms.txt Sets the threshold for determining small exact matches that should be skipped during patch creation. The default is 12 bytes. Setting to 0 means no matches will be skipped. ```APIDOC ## Bsdiff::small_match - Configure Match Threshold ### Description Sets the threshold for determining small exact matches that should be skipped. The default is 12 bytes (`SMALL_MATCH`). Setting to 0 means no matches will be skipped. ### Method `Bsdiff::small_match` ### Parameters #### Query Parameters - **threshold** (usize) - Required - The minimum size in bytes for an exact match to be considered. ### Request Example ```rust use std::io; use qbsdiff::Bsdiff; fn create_patch_with_custom_match_threshold(source: &[u8], target: &[u8]) -> io::Result> { let mut patch = Vec::new(); Bsdiff::new(source, target) .small_match(16) // Skip matches smaller than 16 bytes .compare(io::Cursor::new(&mut patch))?; Ok(patch) } ``` ``` -------------------------------- ### Bsdiff::small_match - Configure Match Threshold Source: https://context7.com/hucsmn/qbsdiff/llms.txt Sets the threshold for determining small exact matches that should be skipped during patch creation. The default is 12 bytes. Setting to 0 means no matches will be skipped. ```rust use std::io; use qbsdiff::Bsdiff; fn create_patch_with_custom_match_threshold(source: &[u8], target: &[u8]) -> io::Result> { let mut patch = Vec::new(); Bsdiff::new(source, target) .small_match(16) // Skip matches smaller than 16 bytes .compare(io::Cursor::new(&mut patch))?; Ok(patch) } ``` -------------------------------- ### Bspatch::buffer_size - Configure Copy Buffer Size Source: https://context7.com/hucsmn/qbsdiff/llms.txt Sets the main copy buffer size for the patching operation. The default is 131072 bytes (128 KiB). Larger buffers speed up writing to unbuffered outputs like `std::fs::File`. ```APIDOC ## Bspatch::buffer_size - Configure Copy Buffer Size ### Description Sets the main copy buffer size for the patching operation. The default is 131072 bytes (128 KiB). Larger buffers speed up writing to unbuffered outputs like `std::fs::File`. ### Method `Bspatch::buffer_size` ### Parameters #### Query Parameters - **size** (usize) - Required - The size of the copy buffer in bytes. ### Request Example ```rust use std::io; use qbsdiff::Bspatch; fn apply_patch_with_custom_buffer(source: &[u8], patch: &[u8]) -> io::Result> { let mut target = Vec::new(); Bspatch::new(patch)? .buffer_size(4096) // 4 KiB buffer for memory-constrained environments .delta_min(1024) // 1 KiB initial delta cache .apply(source, io::Cursor::new(&mut target))?; Ok(target) } ``` ``` -------------------------------- ### Bspatch::buffer_size - Configure Copy Buffer Size Source: https://context7.com/hucsmn/qbsdiff/llms.txt Sets the main copy buffer size for the patching operation. The default is 131072 bytes (128 KiB). Larger buffers speed up writing to unbuffered outputs like `std::fs::File`. ```rust use std::io; use qbsdiff::Bspatch; fn apply_patch_with_custom_buffer(source: &[u8], patch: &[u8]) -> io::Result> { let mut target = Vec::new(); Bspatch::new(patch)? .buffer_size(4096) // 4 KiB buffer for memory-constrained environments .delta_min(1024) // 1 KiB initial delta cache .apply(source, io::Cursor::new(&mut target))?; Ok(target) } ``` -------------------------------- ### Bsdiff::compression_level - Set bzip2 Compression Level Source: https://context7.com/hucsmn/qbsdiff/llms.txt Sets the bzip2 compression level for the patch file output. Valid values range from 0 (no compression) to 9 (maximum compression). ```APIDOC ## Bsdiff::compression_level - Set bzip2 Compression Level ### Description Configures the bzip2 compression level for the generated patch file. ### Method POST (Conceptual - This is a library function, not a direct HTTP endpoint) ### Endpoint N/A (Library function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None (Operates on byte slices) ### Request Example ```rust use std::io; use qbsdiff::Bsdiff; // Fast compression (level 1) let mut patch_fast = Vec::new(); Bsdiff::new(source, target) .compression_level(1) .compare(io::Cursor::new(&mut patch_fast))?; // Maximum compression (level 9) let mut patch_max = Vec::new(); Bsdiff::new(source, target) .compression_level(9) .compare(io::Cursor::new(&mut patch_max))?; ``` ### Response #### Success Response (200) None (Returns the size of the generated patch in bytes) #### Response Example None (Function returns io::Result<()>) ``` -------------------------------- ### Bsdiff::buffer_size - Configure Delta Calculation Buffer Source: https://context7.com/hucsmn/qbsdiff/llms.txt Sets the buffer size used during delta calculation. The minimum is 128 bytes and the default is 4096 bytes. Larger buffers may improve performance for large files. ```APIDOC ## Bsdiff::buffer_size - Configure Delta Calculation Buffer ### Description Configures the buffer size used internally during the delta calculation process. ### Method POST (Conceptual - This is a library function, not a direct HTTP endpoint) ### Endpoint N/A (Library function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None (Operates on byte slices) ### Request Example ```rust use std::io; use qbsdiff::{Bsdiff, ParallelScheme}; // Using a 64 KiB buffer let mut patch = Vec::new(); Bsdiff::new(source, target) .buffer_size(65536) .compression_level(1) .parallel_scheme(ParallelScheme::Never) .compare(io::Cursor::new(&mut patch))?; ``` ### Response #### Success Response (200) None (Returns the size of the generated patch in bytes) #### Response Example None (Function returns io::Result<()>) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.