示例#1
0
        public static byte[] Dump(BSONObject obj)
        {
            SimpleBSON   bson = new SimpleBSON();
            MemoryStream ms   = new MemoryStream();

            bson.encodeDocument(ms, obj);

            byte[] buf = new byte[ms.Position];
            ms.Seek(0, SeekOrigin.Begin);
            ms.Read(buf, 0, buf.Length);

            return(buf);
        }
		public static byte[] Dump(BSONObject obj) {
			
			SimpleBSON bson = new SimpleBSON ();
			MemoryStream ms = new MemoryStream ();

			bson.encodeDocument (ms, obj);

			byte[] buf = new byte[ms.Position];
			ms.Seek (0, SeekOrigin.Begin);  
			ms.Read (buf, 0, buf.Length);

			return buf;
		}
示例#3
0
        public static BSONObject Load(byte[] buf)
        {
            SimpleBSON bson = new SimpleBSON(buf);

            return(bson.decodeDocument());
        }
		//private BinaryWriter mBinaryWriter;

		public static BSONObject Load(byte[] buf) {
			SimpleBSON bson = new SimpleBSON (buf);

			return bson.decodeDocument ();
		}