From 8e195930452b69b3fd45cb98b30f48b5a51dd594 Mon Sep 17 00:00:00 2001 From: Shizuo Fujita Date: Sun, 28 Jun 2026 03:14:23 +0900 Subject: [PATCH] Fix incorrect sample code in README Co-Authored-By: Claude Opus 4.8 (1M context) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 06ceef3..d20c093 100644 --- a/README.md +++ b/README.md @@ -116,7 +116,7 @@ res << stream.finish #### Streaming Compression with CDict of level 5 ```ruby -cdict = Zstd::CDict.new(File.read('dictionary_file', 5) +cdict = Zstd::CDict.new(File.read('dictionary_file'), 5) stream = Zstd::StreamingCompress.new(dict: cdict) stream << "abc" << "def" res = stream.flush @@ -143,8 +143,8 @@ Zstd.decompress(compressed_using_dict, dict: File.read('dictionary_file')) If you use the same dictionary repeatedly, you can speed up the setup by creating DDict in advance: ```ruby -ddict = Zstd::Ddict.new(File.read('dictionary_file')) -data = Zstd.compress(compressed_using_dict, ddict) +ddict = Zstd::DDict.new(File.read('dictionary_file')) +data = Zstd.decompress(compressed_using_dict, dict: ddict) ``` #### Streaming Decompression