public static HostedSparseExtentHeader Read(byte[] buffer, int offset) { HostedSparseExtentHeader hdr = new HostedSparseExtentHeader(); hdr.MagicNumber = Utilities.ToUInt32LittleEndian(buffer, offset + 0); hdr.Version = Utilities.ToUInt32LittleEndian(buffer, offset + 4); hdr.Flags = (HostedSparseExtentFlags)Utilities.ToUInt32LittleEndian(buffer, offset + 8); hdr.Capacity = Utilities.ToInt64LittleEndian(buffer, offset + 0x0C); hdr.GrainSize = Utilities.ToInt64LittleEndian(buffer, offset + 0x14); hdr.DescriptorOffset = Utilities.ToInt64LittleEndian(buffer, offset + 0x1C); hdr.DescriptorSize = Utilities.ToInt64LittleEndian(buffer, offset + 0x24); hdr.NumGTEsPerGT = Utilities.ToUInt32LittleEndian(buffer, offset + 0x2C); hdr.RgdOffset = Utilities.ToInt64LittleEndian(buffer, offset + 0x30); hdr.GdOffset = Utilities.ToInt64LittleEndian(buffer, offset + 0x38); hdr.Overhead = Utilities.ToInt64LittleEndian(buffer, offset + 0x40); hdr.UncleanShutdown = buffer[offset + 0x48]; hdr.SingleEndLineChar = buffer[offset + 0x49]; hdr.NonEndLineChar = buffer[offset + 0x4A]; hdr.DoubleEndLineChar1 = buffer[offset + 0x4B]; hdr.DoubleEndLineChar2 = buffer[offset + 0x4C]; hdr.CompressAlgorithm = Utilities.ToUInt16LittleEndian(buffer, offset + 0x4D); return hdr; }
public static HostedSparseExtentHeader Read(byte[] buffer, int offset) { HostedSparseExtentHeader hdr = new HostedSparseExtentHeader(); hdr.MagicNumber = Utilities.ToUInt32LittleEndian(buffer, offset + 0); hdr.Version = Utilities.ToUInt32LittleEndian(buffer, offset + 4); hdr.Flags = (HostedSparseExtentFlags)Utilities.ToUInt32LittleEndian(buffer, offset + 8); hdr.Capacity = Utilities.ToInt64LittleEndian(buffer, offset + 0x0C); hdr.GrainSize = Utilities.ToInt64LittleEndian(buffer, offset + 0x14); hdr.DescriptorOffset = Utilities.ToInt64LittleEndian(buffer, offset + 0x1C); hdr.DescriptorSize = Utilities.ToInt64LittleEndian(buffer, offset + 0x24); hdr.NumGTEsPerGT = Utilities.ToUInt32LittleEndian(buffer, offset + 0x2C); hdr.RgdOffset = Utilities.ToInt64LittleEndian(buffer, offset + 0x30); hdr.GdOffset = Utilities.ToInt64LittleEndian(buffer, offset + 0x38); hdr.Overhead = Utilities.ToInt64LittleEndian(buffer, offset + 0x40); hdr.UncleanShutdown = buffer[offset + 0x48]; hdr.SingleEndLineChar = buffer[offset + 0x49]; hdr.NonEndLineChar = buffer[offset + 0x4A]; hdr.DoubleEndLineChar1 = buffer[offset + 0x4B]; hdr.DoubleEndLineChar2 = buffer[offset + 0x4C]; hdr.CompressAlgorithm = Utilities.ToUInt16LittleEndian(buffer, offset + 0x4D); return(hdr); }