class LibZip::OutputStream

A write handle on 1 entry, from LibZip::File#get_output_stream.

zip.get_output_stream("data.csv") do |out|
  out.write("a,b,c\n")
  out << "1,2,3\n"
end

What you write is buffered in memory, and becomes an entry only on close, which the block form calls for you. A stream that isn’t closed, because the block failed or because the garbage collector took it, adds no entry. The entry is written to disk when the archive is closed.