Пример #1
0
        /// <summary>
        /// 读取压缩头文件
        /// </summary>
        /// <param name="stream"></param>
        /// <returns></returns>
        private CompressHeader ReadCompressHeader(MemoryStream stream)
        {
            BinaryReader reader = new BinaryReader(stream);

            stream.Seek(0, SeekOrigin.Begin);
            CompressHeader header = new CompressHeader();

            header.TotalSize = reader.ReadUInt32();
            //读取第一个Block的偏移位置
            header.BlockOffset = new List <uint>();
            header.BlockOffset.Add(reader.ReadUInt32());
            while (stream.Position < header.BlockOffset[0])
            {
                header.BlockOffset.Add(reader.ReadUInt32());
            }
            return(header);
        }
Пример #2
0
        /// <summary>
        /// 读取压缩头文件
        /// </summary>
        /// <param name="stream"></param>
        /// <returns></returns>
        private CompressHeader ReadCompressHeader(MemoryStream stream)
        {
            BinaryReader reader = new BinaryReader(stream);

            stream.Seek(0, SeekOrigin.Begin);
            CompressHeader header = new CompressHeader();
            header.TotalSize = reader.ReadUInt32();
            //读取第一个Block的偏移位置
            header.BlockOffset = new List<uint>();
            header.BlockOffset.Add(reader.ReadUInt32());
            while (stream.Position < header.BlockOffset[0])
            {
                header.BlockOffset.Add(reader.ReadUInt32());
            }
            return header;
        }