public HFSPlusCatalogFile(ref byte[] rawData) : base(ref rawData) { ushort flags = dataOperations.convToLE(BitConverter.ToUInt16(rawData, 2)); this.fileLockedBit = (fileFlags.kHFSFileLockedBit & (fileFlags)flags) == fileFlags.kHFSFileLockedBit; this.fileLockedMask = (fileFlags.kHFSFileLockedMask & (fileFlags)flags) == fileFlags.kHFSFileLockedMask; this.threadExistsBit = (fileFlags.kHFSThreadExistsBit & (fileFlags)flags) == fileFlags.kHFSThreadExistsBit; this.threadExistsMask = (fileFlags.kHFSThreadExistsMask & (fileFlags)flags) == fileFlags.kHFSThreadExistsMask; this.reserved1 = dataOperations.convToLE(BitConverter.ToUInt32(rawData, 4)); this.fileID = dataOperations.convToLE(BitConverter.ToUInt32(rawData, 8)); this.createDate = HFSPlus.FromHFSPlusTime(dataOperations.convToLE(BitConverter.ToUInt32(rawData, 12))); this.contentModDate = HFSPlus.FromHFSPlusTime(dataOperations.convToLE(BitConverter.ToUInt32(rawData, 16))); this.attributeModDate = HFSPlus.FromHFSPlusTime(dataOperations.convToLE(BitConverter.ToUInt32(rawData, 20))); this.accessDate = HFSPlus.FromHFSPlusTime(dataOperations.convToLE(BitConverter.ToUInt32(rawData, 24))); this.backupDate = HFSPlus.FromHFSPlusTime(dataOperations.convToLE(BitConverter.ToUInt32(rawData, 28))); byte[] filePermissions = new byte[16]; Array.Copy(rawData, 32, filePermissions, 0, 16); byte[] fileUserInfo = new byte[16]; Array.Copy(rawData, 48, fileUserInfo, 0, 16); byte[] fileFinderInfo = new byte[16]; Array.Copy(rawData, 64, fileFinderInfo, 0, 16); this.userInfo = HFSPlusFinderInfo.getFileUserInfo(ref fileUserInfo); this.finderInfo = HFSPlusFinderInfo.getFileFinderInfo(ref fileFinderInfo); this.permissions = getHFSPlusPermissions(ref filePermissions); this.textEncoding = dataOperations.convToLE(BitConverter.ToUInt32(rawData, 80)); this.reserved2 = dataOperations.convToLE(BitConverter.ToUInt32(rawData, 84)); this.dataFork = new hfsPlusForkData(ref rawData, 88); this.resourceFork = new hfsPlusForkData(ref rawData, 168); }
public HFSPlusCatalogFolder(ref byte[] rawData) : base(ref rawData) { this.flags = dataOperations.convToLE(BitConverter.ToUInt16(rawData, 2)); this.valence = dataOperations.convToLE(BitConverter.ToUInt32(rawData, 4)); this.folderID = dataOperations.convToLE(BitConverter.ToUInt32(rawData, 8)); this.createDate = HFSPlus.FromHFSPlusTime(dataOperations.convToLE(BitConverter.ToUInt32(rawData, 12))); this.contentModDate = HFSPlus.FromHFSPlusTime(dataOperations.convToLE(BitConverter.ToUInt32(rawData, 16))); this.attributeModDate = HFSPlus.FromHFSPlusTime(dataOperations.convToLE(BitConverter.ToUInt32(rawData, 20))); this.accessDate = HFSPlus.FromHFSPlusTime(dataOperations.convToLE(BitConverter.ToUInt32(rawData, 24))); this.backupDate = HFSPlus.FromHFSPlusTime(dataOperations.convToLE(BitConverter.ToUInt32(rawData, 28))); byte[] folderPermissions = new byte[16]; Array.Copy(rawData, 32, folderPermissions, 0, 16); byte[] folderUserInfo = new byte[16]; Array.Copy(rawData, 48, folderUserInfo, 0, 16); byte[] folderFinderInfo = new byte[16]; Array.Copy(rawData, 64, folderFinderInfo, 0, 16); this.userInfo = HFSPlusFinderInfo.getFolderUserInfo(ref folderUserInfo); this.finderInfo = HFSPlusFinderInfo.getFolderFinderInfo(ref folderFinderInfo); this.permissions = getHFSPlusPermissions(ref folderPermissions); this.textEncoding = dataOperations.convToLE(BitConverter.ToUInt32(rawData, 80)); this.reserved = dataOperations.convToLE(BitConverter.ToUInt32(rawData, 84)); }