Class Mongo::Protocol::Serializers::BitVector
In: lib/mongo/protocol/bit_vector.rb
Parent: Object

Class used to define a bitvector for a MongoDB wire protocol message.

Defines serialization strategy upon initialization.

@api private

Methods

deserialize   new   serialize  

Public Class methods

Initializes a BitVector with a layout

@param layout [ Array<Symbol> ] the array of fields in the bit vector

Public Instance methods

Deserializes vector by decoding the symbol according to its mask

@param [ String ] buffer Buffer containing the vector to be deserialized.

@return [ Array<Symbol> ] Flags contained in the vector

Serializes vector by encoding each symbol according to its mask

@param buffer [ String ] Buffer to receive the serialized vector @param value [ Array<Symbol> ] Array of flags to encode

@return [ String ] Buffer that received the serialized vector

[Validate]