123456789_123456789_123456789_123456789_123456789_

Module: Mongo::Protocol::Serializers::CString Private

Relationships & Source Files
Defined in: lib/mongo/protocol/serializers.rb

Overview

MongoDB wire protocol serialization strategy for C style strings.

Serializes and de-serializes C style strings (null terminated).

Class Method Summary

Class Method Details

.serialize(buffer, value, validating_keys = nil) ⇒ String

Serializes a C style string into the buffer

Parameters:

  • buffer (String)

    Buffer to receive the serialized CString.

  • value (String)

    The string to be serialized.

Returns:

  • (String)

    Buffer with serialized value.

[ GitHub ]

  
# File 'lib/mongo/protocol/serializers.rb', line 85

def self.serialize(buffer, value, validating_keys = nil)
  buffer.put_cstring(value)
end