class BSON::BSON_JAVA
Public Class Methods
deserialize(buf, opts={})
click to toggle source
# File lib/bson/bson_java.rb, line 31 def self.deserialize(buf, opts={}) dec = Java::OrgJbson::RubyBSONDecoder.new callback = Java::OrgJbson::RubyBSONCallback.new(JRuby.runtime) callback.set_opts(opts); dec.decode(buf.to_s.to_java_bytes, callback) callback.get end
max_bson_size()
click to toggle source
# File lib/bson/bson_java.rb, line 39 def self.max_bson_size warn "BSON::BSON_CODER.max_bson_size is deprecated and will be removed in v2.0." Java::OrgJbson::RubyBSONEncoder.max_bson_size(self) end
serialize(obj, check_keys=false, move_id=false, max_bson_size=DEFAULT_MAX_BSON_SIZE)
click to toggle source
# File lib/bson/bson_java.rb, line 25 def self.serialize(obj, check_keys=false, move_id=false, max_bson_size=DEFAULT_MAX_BSON_SIZE) raise InvalidDocument, "BSON_JAVA.serialize takes a Hash" unless obj.is_a?(Hash) enc = Java::OrgJbson::RubyBSONEncoder.new(JRuby.runtime, check_keys, move_id, max_bson_size) ByteBuffer.new(enc.encode(obj)) end
update_max_bson_size(connection)
click to toggle source
# File lib/bson/bson_java.rb, line 44 def self.update_max_bson_size(connection) warn "BSON::BSON_CODER.update_max_bson_size is deprecated and now a no-op. It will be removed in v2.0." Java::OrgJbson::RubyBSONEncoder.update_max_bson_size(self, connection) end