# File lib/moped/bson/extensions/hash.rb, line 25 def __bson_load__(io, doc = new) io.read(4) # Swallow the first four (length) bytes while (buf = io.readbyte) != 0 key = io.gets(NULL_BYTE).from_utf8_binary.chop! if native_class = Types::MAP[buf] doc[key] = native_class.__bson_load__(io) end end doc end