Compress::BZ2::Reader
Inherits IO::Buffered < IO < Reference < Object
A read-only IO object to decompress data in the bzip2 format.
Instances of this class wrap another IO object. When you read from this
instance, it reads data from the underlying IO, decompresses it, and
returns it to the caller.
Example: decompress a file
require "bz2"
string = File.open("file.bz2") do |file|
Compress::BZ2::Reader.open(file) do |bz2|
bz2.gets_to_end
end
end
pp string
Constructors
Creates an instance of BZ2::Reader.
small, when true, makes decompression use a slower algorithm that
needs less memory - the same trade-off bzip2 -s makes.
Class methods
Creates a new reader from the given io, yields it to the given block, and closes it at the end.
Instance methods
sync_close=(sync_close : Bool)
If #sync_close? is true, closing this IO will close the underlying IO.