Sha256: dc496aec3009a83757fd0da60aeeca21fc68e3c89d928e0837a8a1dfdcb07dfc

Contents?: true

Size: 546 Bytes

Versions: 8

Compression:

Stored size: 546 Bytes

Contents

# encoding: utf-8
# frozen_string_literal: true

require 'stringio'
require 'snappy/hadoop/reader'
require 'snappy/hadoop/writer'

module Snappy
  module Hadoop
    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

    def self.inflate(source)
      Snappy::Hadoop::Reader.new(StringIO.new(source)).read
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
snappy-0.4.0-java lib/snappy/hadoop.rb
snappy-0.4.0 lib/snappy/hadoop.rb
snappy-0.3.0-java lib/snappy/hadoop.rb
snappy-0.3.0 lib/snappy/hadoop.rb
snappy-0.2.0-java lib/snappy/hadoop.rb
snappy-0.2.0 lib/snappy/hadoop.rb
snappy-0.1.0-java lib/snappy/hadoop.rb
snappy-0.1.0 lib/snappy/hadoop.rb