Sha256: 2403606449c43f5775c67c12f044e95a84a8969f7e8cdbd1fd3a1b1b137b2ce3

Contents?: true

Size: 620 Bytes

Versions: 29

Compression:

Stored size: 620 Bytes

Contents

# This code is free software; you can redistribute it and/or modify it under
# the terms of the new BSD License.
#
# Copyright (c) 2013-2017, Sebastian Staudt

class RBzip2::Java::Compressor

  def initialize(io)
    @io = RBzip2::Java::BZip2CompressorOutputStream.new io.to_outputstream
  end

  def flush
    @io.flush
  end

  def close
    @io.close
  end

  def putc(int)
    if int.is_a? Numeric
      write int & 0xff
    else
      write int.to_s[0]
    end
  end

  def puts(line)
    write line + $/
  end

  def write(bytes)
    raise 'stream closed' if @io.nil?

    @io.write bytes.to_java_bytes
  end

end

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
logstash-output-scalyr-0.1.9 vendor/bundle/jruby/2.5.0/gems/rbzip2-0.3.0/lib/rbzip2/java/compressor.rb
logstash-output-scalyr-0.1.8 vendor/bundle/jruby/2.5.0/gems/rbzip2-0.3.0/lib/rbzip2/java/compressor.rb
logstash-output-scalyr-0.1.7 vendor/bundle/jruby/2.5.0/gems/rbzip2-0.3.0/lib/rbzip2/java/compressor.rb
logstash-output-scalyr-0.1.6 vendor/bundle/jruby/2.5.0/gems/rbzip2-0.3.0/lib/rbzip2/java/compressor.rb
logstash-output-scalyr-0.1.5 vendor/bundle/jruby/2.5.0/gems/rbzip2-0.3.0/lib/rbzip2/java/compressor.rb
logstash-output-scalyr-0.1.4 vendor/bundle/jruby/2.5.0/gems/rbzip2-0.3.0/lib/rbzip2/java/compressor.rb
logstash-output-scalyr-0.1.3 vendor/bundle/jruby/2.5.0/gems/rbzip2-0.3.0/lib/rbzip2/java/compressor.rb
logstash-output-scalyr-0.1.2 vendor/bundle/jruby/2.5.0/gems/rbzip2-0.3.0/lib/rbzip2/java/compressor.rb
rbzip2-0.3.0 lib/rbzip2/java/compressor.rb