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



25
26
27
28
29
30
31
32
# File 'lib/moped/bson/extensions/array.rb', line 25

def __bson_load__(io, array = new)
  io.read(4) # Swallow the first four (length) bytes
  while (buf = io.readbyte) != 0
    io.gets(NULL_BYTE)
    array << Types::MAP[buf].__bson_load__(io)
  end
  array
end