Esempio n. 1
0
        public void addResourceExtentsToFork(hfsPlusForkData.HFSPlusExtentRecord anExtent)
        {
            fileContent.resourceExtents.Add(anExtent);

            getKnownResourceBlocks();
            this.allResourceBlocksKnown = knownResourceBlocks == totalDataBlocks;
        }
        private void getRecords()
        {
            foreach (rawKeyAndRecord record in this.rawRecords)
            {
                extentsOverflowFile.HFSPlusExtentKey key        = new extentsOverflowFile.HFSPlusExtentKey();
                extentsOverflowLeafRecord            leafRecord = new extentsOverflowLeafRecord();
                leafRecord.extents = new hfsPlusForkData.HFSPlusExtentRecord[8];

                key.keyLength  = record.keyLength;
                key.type       = (extentsOverflowFile.forkType)record.keyData[0];
                key.pad        = record.keyData[1];
                key.fileID     = dataOperations.convToLE(BitConverter.ToUInt32(record.keyData, 2));
                key.startBlock = dataOperations.convToLE(BitConverter.ToUInt32(record.keyData, 6));

                leafRecord.key = key;

                for (int i = 0; i < 8; i++)
                {
                    hfsPlusForkData.HFSPlusExtentRecord extent = new hfsPlusForkData.HFSPlusExtentRecord();

                    extent.startBlock = dataOperations.convToLE(BitConverter.ToUInt32(record.recordData, i * 8));
                    extent.blockCount = dataOperations.convToLE(BitConverter.ToUInt32(record.recordData, (i * 8) + 4));

                    leafRecord.extents[i] = extent;
                }

                this.records.Add(leafRecord);
            }
        }
        private void getRecords()
        {
            foreach (rawKeyAndRecord record in this.rawRecords)
            {

                extentsOverflowFile.HFSPlusExtentKey key = new extentsOverflowFile.HFSPlusExtentKey();
                extentsOverflowLeafRecord leafRecord = new extentsOverflowLeafRecord();
                leafRecord.extents = new hfsPlusForkData.HFSPlusExtentRecord[8];

                key.keyLength = record.keyLength;
                key.type = (extentsOverflowFile.forkType)record.keyData[0];
                key.pad = record.keyData[1];
                key.fileID = dataOperations.convToLE(BitConverter.ToUInt32(record.keyData, 2));
                key.startBlock = dataOperations.convToLE(BitConverter.ToUInt32(record.keyData, 6));

                leafRecord.key = key;

                for (int i = 0; i < 8; i++)
                {
                    hfsPlusForkData.HFSPlusExtentRecord extent = new hfsPlusForkData.HFSPlusExtentRecord();

                    extent.startBlock = dataOperations.convToLE(BitConverter.ToUInt32(record.recordData, i * 8));
                    extent.blockCount = dataOperations.convToLE(BitConverter.ToUInt32(record.recordData, (i * 8) + 4));

                    leafRecord.extents[i] = extent;
                }

                this.records.Add(leafRecord);
            }
        }