示例#1
0
        /// <summary>
        /// 将后面size字节的数据拷贝到st中
        /// </summary>
        /// <param name="st"></param>
        /// <param name="size"></param>
        public void CopyTo(StreamTool st, int size, byte[] swap)
        {
            var total  = size;
            var batchN = swap.Length;

            while (total > 0)
            {
                var step = total > batchN ? batchN : total;
                In.Read(swap, 0, step);
                st.Out.Write(swap, 0, step);
                total -= step;
            }
        }
示例#2
0
        public void ReadTable_Sync<T>(T loader) where T : ReaL.ILoader, new()
        {
            string fileName = loader.GetFileName();
            try
            {
                string path = GetDestPath(fileName);
                byte[] bytes = StreamTool.OpenRead(path);
               
                ReadTable(bytes, loader);

            }
            catch (Exception ex)
            {
                Logger.LogError("TableManager.ReadTable_Sync----Error---FileName:" + fileName + "\n" + ex.ToString());
            }
        }