# File lib/fog/storage.rb, line 48 def self.get_body_size(body) if body.respond_to?(:force_encoding) body.force_encoding('BINARY') end if body.respond_to?(:bytesize) body.bytesize elsif body.respond_to?(:size) body.size elsif body.respond_to?(:stat) body.stat.size else 0 end end