Beispiel #1
0
        /// <summary>
        /// Reads a raw BSON array.
        /// </summary>
        /// <returns>
        /// The raw BSON array.
        /// </returns>
        public override IByteBuffer ReadRawBsonArray()
        {
            if (Disposed) { ThrowObjectDisposedException(); }
            VerifyBsonType("ReadRawBsonArray", BsonType.Array);

            var slice = _bsonStream.ReadSlice();

            switch (_context.ContextType)
            {
                case ContextType.Array: State = BsonReaderState.Type; break;
                case ContextType.Document: State = BsonReaderState.Type; break;
                case ContextType.TopLevel: State = BsonReaderState.Initial; break;
                default: throw new BsonInternalException("Unexpected ContextType.");
            }

            return slice;
        }
        static int _m_ReadSlice(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                MongoDB.Bson.IO.BsonStream gen_to_be_invoked = (MongoDB.Bson.IO.BsonStream)translator.FastGetCSObj(L, 1);



                {
                    MongoDB.Bson.IO.IByteBuffer gen_ret = gen_to_be_invoked.ReadSlice(  );
                    translator.PushAny(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }