Esempio n. 1
0
            public DecompressedSectorToCompressedSector()
            {
                helper help = new helper();

                SizeOf  = help.GetHighestBit(Header.CompSectorCount) * (((uint)Header.DecompressedFileSize + (uint)Header.CompSectorSize - 1) / (uint)Header.CompSectorSize);
                SizeOf += 7;
                SizeOf /= 8;
            }
Esempio n. 2
0
            public static DecompressedSectorToCompressedSector[] Read_DecompressedSectorToCompressedSector(Stream s)
            {
                helper help = new helper();
                uint   temp = help.GetHighestBit(Header.CompSectorCount);
                DecompressedSectorToCompressedSector d = new DecompressedSectorToCompressedSector();
                uint sector = (((uint)Header.DecompressedFileSize + (uint)Header.CompSectorSize - 1) / (uint)Header.CompSectorSize);
                uint pos    = 0;

                byte[] block = ReturnBlock(s, d.SizeOf);
                DecompressedSectorToCompressedSector[] result = new DecompressedSectorToCompressedSector[sector];

                for (uint i = 0; i < sector; i++)
                {
                    result[i] = new DecompressedSectorToCompressedSector();
                    result[i].DecompressedSector = i;
                    result[i].CompressedSector   = help.ReadBits(block, pos, temp);
                    pos += temp;
                }
                return(result);
            }