Module: Ronin::Support::Compression
- Defined in:
- lib/ronin/support/compression.rb,
lib/ronin/support/compression/gzip.rb,
lib/ronin/support/compression/zlib.rb,
lib/ronin/support/compression/mixin.rb,
lib/ronin/support/compression/gzip/reader.rb,
lib/ronin/support/compression/gzip/writer.rb
Overview
Methods for compressing and uncompressing data.
Core-Ext Methods
Defined Under Namespace
Class Method Summary collapse
-
.gunzip(path) {|gz| ... } ⇒ Gzip::Reader
Opens the gzipped file for reading.
-
.gzip(path) {|gz| ... } ⇒ Gzip::Writer
Opens the gzip file for writing.
-
.gzip_open(path, mode: 'r') {|output| ... } ⇒ Gzip::Writer
Opens a gzip file for reading or writing.
-
.gzip_stream(io, mode: 'r') {|gz| ... } ⇒ Gzip::Reader, Gzip::Writer
Creates a gzip stream around the IO object.
-
.zlib_deflate(string) ⇒ String
Zlib deflate a string.
-
.zlib_inflate(string) ⇒ String
Zlib inflate a string.
Class Method Details
.gunzip(path) {|gz| ... } ⇒ Gzip::Reader
Opens the gzipped file for reading.
157 158 159 |
# File 'lib/ronin/support/compression.rb', line 157 def self.gunzip(path,&block) gzip_open(path,&block) end |
.gzip(path) {|gz| ... } ⇒ Gzip::Writer
Opens the gzip file for writing.
180 181 182 |
# File 'lib/ronin/support/compression.rb', line 180 def self.gzip(path,&block) gzip_open(path, mode: 'w', &block) end |
.gzip_open(path, mode: 'r') {|output| ... } ⇒ Gzip::Writer
Opens a gzip file for reading or writing.
134 135 136 |
# File 'lib/ronin/support/compression.rb', line 134 def self.gzip_open(path, mode: 'r', &block) Gzip.open(path, mode: mode, &block) end |
.gzip_stream(io, mode: 'r') {|gz| ... } ⇒ Gzip::Reader, Gzip::Writer
Creates a gzip stream around the IO object.
105 106 107 |
# File 'lib/ronin/support/compression.rb', line 105 def self.gzip_stream(io, mode: 'r', &block) Gzip.new(io, mode: mode, &block) end |