Bytes — Documentation by YARD 0.9.37 (original) (raw)

Module: Mongo::Protocol::Serializers::BytesPrivate

Defined in:

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 Summarycollapse

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.

| 460 461 462 463 | # File 'lib/mongo/protocol/serializers.rb', line 460 def self.deserialize(buffer, options = {}) num_bytes = options[:num_bytes] buffer.get_bytes(num_bytes || buffer.length) end | | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

.serialize(buffer, value, validating_keys = nil) ⇒ 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.

446 447 448 # File 'lib/mongo/protocol/serializers.rb', line 446 def self.serialize(buffer, value, validating_keys = nil) buffer.put_bytes(value) end