public string readString() { Int16 nStrLen = 0; nStrLen = readInt16(); System.Diagnostics.Debug.Assert(m_pBuffer.dataSize() >= nStrLen); byte[] b = m_pBuffer.readBytes(nStrLen); string s = System.Text.Encoding.Default.GetString(b); return(s); }
static int dataSize(IntPtr L) { try { ToLua.CheckArgsCount(L, 1); NetCore.ByteArray obj = (NetCore.ByteArray)ToLua.CheckObject(L, 1, typeof(NetCore.ByteArray)); int o = obj.dataSize(); LuaDLL.lua_pushinteger(L, o); return 1; } catch(Exception e) { return LuaDLL.toluaL_exception(L, e); } }