When calling the write method more than once is ignoring new data:
def bz2_read_file(file_name)
File.open(file_name) do |file|
io = RBzip2.default_adapter::Decompressor.new(file)
data = io.read
io.close
data
end
end
File.open("test3.bz2", "wb") do |file|
writer = RBzip2.default_adapter::Compressor.new(file)
writer.write("line1\n")
writer.write("line2\n")
writer.write("line3\n")
writer.close
end
bz2_read_file("test3.bz2")
Only the first line is returned from the output file:
When calling the write method more than once is ignoring new data:
Only the first line is returned from the output file: