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.2.1.beta vendor/bundle/jruby/2.5.0/gems/rbzip2-0.3.0/lib/rbzip2/java/compressor.rb
logstash-output-scalyr-0.2.0 vendor/bundle/jruby/2.5.0/gems/rbzip2-0.3.0/lib/rbzip2/java/compressor.rb
logstash-output-scalyr-0.2.0.beta vendor/bundle/jruby/2.5.0/gems/rbzip2-0.3.0/lib/rbzip2/java/compressor.rb
logstash-output-scalyr-0.1.26.beta vendor/bundle/jruby/2.5.0/gems/rbzip2-0.3.0/lib/rbzip2/java/compressor.rb
logstash-output-scalyr-0.1.25.beta vendor/bundle/jruby/2.5.0/gems/rbzip2-0.3.0/lib/rbzip2/java/compressor.rb
logstash-output-scalyr-0.1.24.beta vendor/bundle/jruby/2.5.0/gems/rbzip2-0.3.0/lib/rbzip2/java/compressor.rb
logstash-output-scalyr-0.1.23.beta vendor/bundle/jruby/2.5.0/gems/rbzip2-0.3.0/lib/rbzip2/java/compressor.rb
logstash-output-scalyr-0.1.22.beta vendor/bundle/jruby/2.5.0/gems/rbzip2-0.3.0/lib/rbzip2/java/compressor.rb
logstash-output-scalyr-0.1.21.beta vendor/bundle/jruby/2.5.0/gems/rbzip2-0.3.0/lib/rbzip2/java/compressor.rb
logstash-output-scalyr-0.1.20.beta vendor/bundle/jruby/2.5.0/gems/rbzip2-0.3.0/lib/rbzip2/java/compressor.rb
logstash-output-scalyr-0.1.19.beta vendor/bundle/jruby/2.5.0/gems/rbzip2-0.3.0/lib/rbzip2/java/compressor.rb
logstash-output-scalyr-0.1.18.beta vendor/bundle/jruby/2.5.0/gems/rbzip2-0.3.0/lib/rbzip2/java/compressor.rb
logstash-output-scalyr-0.1.17.beta vendor/bundle/jruby/2.5.0/gems/rbzip2-0.3.0/lib/rbzip2/java/compressor.rb
logstash-output-scalyr-0.1.16.beta vendor/bundle/jruby/2.5.0/gems/rbzip2-0.3.0/lib/rbzip2/java/compressor.rb
logstash-output-scalyr-0.1.15.beta vendor/bundle/jruby/2.5.0/gems/rbzip2-0.3.0/lib/rbzip2/java/compressor.rb
logstash-output-scalyr-0.1.14.beta vendor/bundle/jruby/2.5.0/gems/rbzip2-0.3.0/lib/rbzip2/java/compressor.rb
logstash-output-scalyr-0.1.13 vendor/bundle/jruby/2.5.0/gems/rbzip2-0.3.0/lib/rbzip2/java/compressor.rb
logstash-output-scalyr-0.1.12 vendor/bundle/jruby/2.5.0/gems/rbzip2-0.3.0/lib/rbzip2/java/compressor.rb
logstash-output-scalyr-0.1.11.beta vendor/bundle/jruby/2.5.0/gems/rbzip2-0.3.0/lib/rbzip2/java/compressor.rb
logstash-output-scalyr-0.1.10.beta vendor/bundle/jruby/2.5.0/gems/rbzip2-0.3.0/lib/rbzip2/java/compressor.rb