From 5b2aa6bc1efe8e9c36157f1f28cae9191343059b Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Wed, 10 Aug 2016 18:22:10 -0400 Subject: add Entry#size --- src/zip.cr | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/zip.cr b/src/zip.cr index aa9006d..1dd666f 100644 --- a/src/zip.cr +++ b/src/zip.cr @@ -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: -- cgit v1.2.3