Module Mongo::Protocol::Serializers::Bytes
In: lib/mongo/protocol/serializers.rb

MongoDB wire protocol serialization strategy for n bytes.

Writes and fetches bytes from the byte buffer.

Methods

Public Class methods

Deserializes bytes from the byte buffer.

@param [ BSON::ByteBuffer ] buffer Buffer containing the value to read. @param [ Integer ] num_bytes Number of bytes to read.

@return [ String ] The bytes.

@since 2.5.0

Writes bytes into the buffer.

@param [ BSON::ByteBuffer ] buffer Buffer to receive the bytes. @param [ String ] value The bytes to write to the buffer. @param [ true, false ] validating_keys Whether to validate keys.

@return [ BSON::ByteBuffer ] Buffer with serialized value.

@since 2.5.0

[Validate]