Module: Mongo::Protocol::Serializers::Bytes Private
- Defined in:
- build/ruby-driver-master/lib/mongo/protocol/serializers.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
MongoDB wire protocol serialization strategy for n bytes.
Writes and fetches bytes from the byte buffer.
Class Method Summary collapse
-
.deserialize(buffer, options = {}) ⇒ String
private
Deserializes bytes from the byte buffer.
-
.serialize(buffer, value, validating_keys = BSON::Config.validating_keys?) ⇒ BSON::ByteBuffer
private
Writes bytes into the buffer.
Class Method Details
.deserialize(buffer, options = {}) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Deserializes bytes from the byte buffer.
453 454 455 456 |
# File 'build/ruby-driver-master/lib/mongo/protocol/serializers.rb', line 453 def self.deserialize(buffer, = {}) num_bytes = [:num_bytes] buffer.get_bytes(num_bytes || buffer.length) end |
.serialize(buffer, value, validating_keys = BSON::Config.validating_keys?) ⇒ BSON::ByteBuffer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Writes bytes into the buffer.
439 440 441 |
# File 'build/ruby-driver-master/lib/mongo/protocol/serializers.rb', line 439 def self.serialize(buffer, value, validating_keys = BSON::Config.validating_keys?) buffer.put_bytes(value) end |