public override int ReadFrom(byte[] buffer, int offset) { base.ReadFrom(buffer, offset); Flags = Utilities.ToUInt16BigEndian(buffer, offset + 2); FileInfo = Utilities.ToStruct<FileInfo>(buffer, offset + 48); DataFork = Utilities.ToStruct<ForkData>(buffer, offset + 88); ResourceFork = Utilities.ToStruct<ForkData>(buffer, offset + 168); return 0; }
public FileBuffer(Context context, ForkData baseData) { _context = context; _baseData = baseData; }
public int ReadFrom(byte[] buffer, int offset) { Signature = Utilities.ToUInt16BigEndian(buffer, offset + 0); Version = Utilities.ToUInt16BigEndian(buffer, offset + 2); Attributes = (VolumeAttributes)Utilities.ToUInt32BigEndian(buffer, offset + 4); LastMountedVersion = Utilities.ToUInt32BigEndian(buffer, offset + 8); JournalInfoBlock = Utilities.ToUInt32BigEndian(buffer, offset + 12); CreateDate = HfsPlusUtilities.ReadHFSPlusDate(DateTimeKind.Local, buffer, offset + 16); ModifyDate = HfsPlusUtilities.ReadHFSPlusDate(DateTimeKind.Utc, buffer, offset + 20); BackupDate = HfsPlusUtilities.ReadHFSPlusDate(DateTimeKind.Utc, buffer, offset + 24); CheckedDate = HfsPlusUtilities.ReadHFSPlusDate(DateTimeKind.Utc, buffer, offset + 28); FileCount = Utilities.ToUInt32BigEndian(buffer, offset + 32); FolderCount = Utilities.ToUInt32BigEndian(buffer, offset + 36); BlockSize = Utilities.ToUInt32BigEndian(buffer, offset + 40); TotalBlocks = Utilities.ToUInt32BigEndian(buffer, offset + 44); FreeBlocks = Utilities.ToUInt32BigEndian(buffer, offset + 48); NextAllocation = Utilities.ToUInt32BigEndian(buffer, offset + 52); ResourceClumpSize = Utilities.ToUInt32BigEndian(buffer, offset + 56); DataClumpSize = Utilities.ToUInt32BigEndian(buffer, offset + 60); NextCatalogId = new CatalogNodeId(Utilities.ToUInt32BigEndian(buffer, offset + 64)); WriteCount = Utilities.ToUInt32BigEndian(buffer, offset + 68); EncodingsBitmap = Utilities.ToUInt64BigEndian(buffer, offset + 72); FinderInfo = new uint[8]; for (int i = 0; i < 8; ++i) { FinderInfo[i] = Utilities.ToUInt32BigEndian(buffer, offset + 80 + (i * 4)); } AllocationFile = (ForkData)Utilities.ToStruct<ForkData>(buffer, offset + 112); ExtentsFile = (ForkData)Utilities.ToStruct<ForkData>(buffer, offset + 192); CatalogFile = (ForkData)Utilities.ToStruct<ForkData>(buffer, offset + 272); AttributesFile = (ForkData)Utilities.ToStruct<ForkData>(buffer, offset + 272); StartupFile = (ForkData)Utilities.ToStruct<ForkData>(buffer, offset + 272); return 512; }