Module: Moped::BSON::Extensions::Array::ClassMethods

Included in:
Array
Defined in:
lib/moped/bson/extensions/array.rb

Instance Method Summary collapse

Instance Method Details

#__bson_load__(io, array = new) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/moped/bson/extensions/array.rb', line 8

def __bson_load__(io, array = new)
  # Swallow the first four (length) bytes
  io.read 4

  while (buf = io.readbyte) != 0
    io.gets(NULL_BYTE)
    array << Types::MAP[buf].__bson_load__(io)
  end

  array
end