private void SetPathTableRecord(uint extentLocation, ushort parentNumber, byte[] identifier) { if (Record == null) { Record = new PathTableRecord(); } Record.Length = (byte)identifier.Length; if (identifier.Length > 255) { throw new Exception("Depasire!"); } Record.Identifier = identifier; Record.ExtentLocation = extentLocation; Record.ParentNumber = parentNumber; if (m_volumeDescriptorType == VolumeType.Suplementary && (identifier.Length > 1 || identifier[0] != 0)) { m_volumeDescriptorType = VolumeType.Primary; VolumeDescriptorType = VolumeType.Suplementary; } }
public int Write(BinaryWriter writer) { if (Record == null) { Record = new PathTableRecord { Length = 1, Identifier = new byte[1] { 65 } }; } writer.Write(Record.Length); writer.Write(Record.ExtendedLength); writer.Write(Record.ExtentLocation); writer.Write(Record.ParentNumber); writer.Write(Record.Identifier); if (Record.Length % 2 == 1) { writer.Write((byte)0); } return(8 + Record.Length + (Record.Length % 2)); }