Sha256: 7b2d78c9ac3547f73052a4afd1385a74d808711680847c9e1c5df0fe7b6a0f22

Contents?: true

Size: 537 Bytes

Versions: 40

Compression:

Stored size: 537 Bytes

Contents

module Embulk
  class Buffer < String
    def self.from_java(java_buffer)
      byte_list = org.jruby.util.ByteList.new(java_buffer.array(), java_buffer.offset(), java_buffer.limit(), false)
      buffer = new
      buffer.replace(org.jruby.RubyString.new(JRuby.runtime, self, byte_list).dup)  # TODO simplify
      buffer
    end

    def self.from_ruby_string(string)
      b = Buffer.new(string)
      b.force_encoding('ASCII-8BIT')
    end

    def to_java
      Java::org.embulk.spi.BufferImpl.wrap(to_java_bytes)
    end
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
embulk-0.11.5-java lib/embulk/buffer.rb
embulk-0.11.3-java lib/embulk/buffer.rb
embulk-0.11.2-java lib/embulk/buffer.rb
embulk-0.11.1-java lib/embulk/buffer.rb
embulk-0.11.0-java lib/embulk/buffer.rb
embulk-0.10.50-java lib/embulk/buffer.rb
embulk-0.10.49-java lib/embulk/buffer.rb
embulk-0.10.48-java lib/embulk/buffer.rb
embulk-0.10.47-java lib/embulk/buffer.rb
embulk-0.10.46-java lib/embulk/buffer.rb
embulk-0.10.45-java lib/embulk/buffer.rb
embulk-0.10.44-java lib/embulk/buffer.rb
embulk-0.10.43-java lib/embulk/buffer.rb
embulk-0.10.42-java lib/embulk/buffer.rb
embulk-0.10.41-java lib/embulk/buffer.rb
embulk-0.10.40-java lib/embulk/buffer.rb
embulk-0.10.39-java lib/embulk/buffer.rb
embulk-0.10.38-java lib/embulk/buffer.rb
embulk-0.10.37-java lib/embulk/buffer.rb
embulk-0.10.31.3-java lib/embulk/buffer.rb