private static BSonDoc DeserializeDocument(BinaryReader reader, BSonDocumentType doctype) { var doc = new BSonDoc(doctype); doc.Name = reader.ReadString(); var size = reader.ReadInt32(); var endposition = reader.BaseStream.Position + size; while (reader.BaseStream.Position < endposition) { var res = NavigateStream(reader); var pp = res as IBSonNode; if (pp != null) { doc[pp.Name] = pp.Value; } } return(doc); }
public BSonDoc(BSonDocumentType doctype = BSonDocumentType.BSON_Document) { DocType = doctype; }