Пример #1
0
        internal override void PrepareForRead()
        {
            _readCache = new byte[Length];
            int pos = 0;

            List<BuildDirectoryInfo> sortedList = new List<BuildDirectoryInfo>(_dirs);
            sortedList.Sort(BuildDirectoryInfo.PathTableSortComparison);

            Dictionary<BuildDirectoryInfo, ushort> dirNumbers = new Dictionary<BuildDirectoryInfo, ushort>(_dirs.Count);
            ushort i = 1;
            foreach (BuildDirectoryInfo di in sortedList)
            {
                dirNumbers[di] = i++;
                PathTableRecord ptr = new PathTableRecord();
                ptr.DirectoryIdentifier = di.PickName(null, _enc);
                ptr.LocationOfExtent = _locations[di];
                ptr.ParentDirectoryNumber = dirNumbers[di.Parent];

                pos += ptr.Write(_byteSwap, _enc, _readCache, pos);
            }
        }
Пример #2
0
        internal override void PrepareForRead()
        {
            _readCache = new byte[Length];
            int pos = 0;

            List <BuildDirectoryInfo> sortedList = new List <BuildDirectoryInfo>(_dirs);

            sortedList.Sort(BuildDirectoryInfo.PathTableSortComparison);

            Dictionary <BuildDirectoryInfo, ushort> dirNumbers = new Dictionary <BuildDirectoryInfo, ushort>(_dirs.Count);
            ushort i = 1;

            foreach (BuildDirectoryInfo di in sortedList)
            {
                dirNumbers[di] = i++;
                PathTableRecord ptr = new PathTableRecord();
                ptr.DirectoryIdentifier   = di.PickName(null, _enc);
                ptr.LocationOfExtent      = _locations[di];
                ptr.ParentDirectoryNumber = dirNumbers[di.Parent];

                pos += ptr.Write(_byteSwap, _enc, _readCache, pos);
            }
        }