Beispiel #1
0
        private void encodeArray(MemoryStream ms, BSONArray lst)
        {
            var obj = new BSONObject();

            for (int i = 0; i < lst.Count; ++i)
            {
                obj.Add(Convert.ToString(i), lst[i]);
            }

            this.encodeDocument(ms, obj);
        }
Beispiel #2
0
        private BSONArray decodeArray()
        {
            BSONObject obj = this.decodeDocument();

            int       i     = 0;
            BSONArray array = new BSONArray();

            while (obj.ContainsKey(Convert.ToString(i)))
            {
                array.Add(obj[Convert.ToString(i)]);

                i += 1;
            }

            return(array);
        }