diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 17 |
1 files changed, 7 insertions, 10 deletions
@@ -33,16 +33,13 @@ end # create memory io mem_io = MemoryIO.new -# open "/some/other/path/image.png" for writing -File.open("/some/other/path/image.png", "wb") do |file_io| - # read from "foo.zip" - Zip.read("foo.zip") do |zip| - # extract "bar.txt" to mem_io - zip["bar.txt"].read(mem_io) - - # extract "image.png" to file_io - zip["image.png"].read(file_io) - end +# read from "foo.zip" +Zip.read("foo.zip") do |zip| + # extract "bar.txt" to mem_io + zip["bar.txt"].write(mem_io) + + # extract "image.png" to "output-image.png" + zip["image.png"].write("output-image.png") end ``` |