diff options
author | Paul Duncan <pabs@pablotron.org> | 2016-08-10 18:22:10 -0400 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2016-08-10 18:22:10 -0400 |
commit | 5b2aa6bc1efe8e9c36157f1f28cae9191343059b (patch) | |
tree | a1291704221595f884ae3c53adb306a2966560ee | |
parent | 9787bfe98af7ec407dbcaa1f00c0aef322255ec2 (diff) | |
download | zip-crystal-5b2aa6bc1efe8e9c36157f1f28cae9191343059b.tar.bz2 zip-crystal-5b2aa6bc1efe8e9c36157f1f28cae9191343059b.zip |
add Entry#size
-rw-r--r-- | src/zip.cr | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -1257,8 +1257,20 @@ module Zip # close data memory io data_mem_io.close + end - nil + # + # Return the uncompressed size of this entry in bytes. + # + # Example: + # + # Zip.read("foo.zip") do |zip| + # size = zip["bar.txt"].size + # puts "bar.txt is #{size} bytes." + # end + # + def size : UInt32 + @uncompressed_size end # :nodoc: |