Module: Snappy::Hadoop
- Defined in:
- lib/snappy/hadoop.rb,
lib/snappy/hadoop/reader.rb,
lib/snappy/hadoop/writer.rb
Defined Under Namespace
Class Method Summary collapse
- .deflate(source, block_size = Snappy::Hadoop::Writer::DEFAULT_BLOCK_SIZE) ⇒ Object
- .inflate(source) ⇒ Object
Class Method Details
.deflate(source, block_size = Snappy::Hadoop::Writer::DEFAULT_BLOCK_SIZE) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/snappy/hadoop.rb', line 10 def self.deflate(source, block_size = Snappy::Hadoop::Writer::DEFAULT_BLOCK_SIZE) compressed_io = StringIO.new writer = Snappy::Hadoop::Writer.new(compressed_io) writer << source writer.flush compressed_io.string end |