class LibZip::InputStream

A read handle on 1 entry, from LibZip::File#get_input_stream.

The entry is decompressed and decrypted in chunks as you read, so memory remains flat whatever the entry’s size.

LibZip::File.open("archive.zip") do |zip|
  zip.get_input_stream("big.csv") do |stream|
    stream.read(64 * 1024) until stream.eof?
  end
end

A stream keeps a libzip handle and has to be closed. The block form of LibZip::File#get_input_stream does that for you; otherwise close does, and LibZip::File#close closes whatever is still open on that archive.