Ejemplo n.º 1
0
        public hfsPlusForkData(ref byte[] rawData, int start)
        {
            forkData theFork = new forkData();

            theFork.extents = new List <HFSPlusExtentRecord>();

            byte[] forkBytes = new byte[80];
            Array.Copy(rawData, start, forkBytes, 0, 80);

            theFork.logicalSize = dataOperations.convToLE(BitConverter.ToUInt64(forkBytes, 0));
            theFork.clumpSize   = dataOperations.convToLE(BitConverter.ToUInt32(forkBytes, 8));
            theFork.totalBlocks = dataOperations.convToLE(BitConverter.ToUInt32(forkBytes, 12));


            start = 16;

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

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

                theFork.extents.Add(extent);
            }

            this.forkDataValues = theFork;
        }
Ejemplo n.º 2
0
        public hfsPlusForkData(ref byte[] rawData, int start)
        {
            forkData theFork = new forkData();
            theFork.extents = new List<HFSPlusExtentRecord>();

            byte[] forkBytes = new byte[80];
            Array.Copy(rawData, start, forkBytes, 0, 80);

            theFork.logicalSize = dataOperations.convToLE(BitConverter.ToUInt64(forkBytes, 0));
            theFork.clumpSize = dataOperations.convToLE(BitConverter.ToUInt32(forkBytes, 8));
            theFork.totalBlocks = dataOperations.convToLE(BitConverter.ToUInt32(forkBytes, 12));

            start = 16;

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

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

                theFork.extents.Add(extent);
            }

            this.forkDataValues = theFork;
        }