public VolumeDescriptor(byte[] b, ISO9660 iso)
     : base(b)
 {
     VolumeFlags                   = b[7];
     SystemIdentifier              = Encoding.ASCII.GetString(b, 8, 32).Trim();
     VolumeIdentifier              = getencoding.GetString(b, 40, 32).Trim();
     VolumeSpaceSize               = BitConverter.ToUInt32(b, 80);
     VolumeSetSize                 = BitConverter.ToUInt16(b, 120);
     VolumeSequenceNumber          = BitConverter.ToUInt16(b, 124);
     LogicalBlockSize              = BitConverter.ToUInt16(b, 128);
     PathTableSize                 = BitConverter.ToUInt32(b, 132);
     TypeLPathTable                = BitConverter.ToUInt32(b, 140);
     OptTypeLPathTable             = BitConverter.ToUInt32(b, 144);
     TypeMPathTable                = Swap(BitConverter.ToUInt32(b, 148));
     OptTypeMPathTable             = Swap(BitConverter.ToUInt32(b, 152));
     DirectoryRecord               = new DirectoryRecord(ToByteArray(b, 156, 34), 0, getencoding, iso);
     VolumeSetIdentifier           = getencoding.GetString(b, 190, 128).Trim();
     PublisherIdentifier           = Encoding.ASCII.GetString(b, 318, 128).Trim();
     DataPreparerIdentifier        = Encoding.ASCII.GetString(b, 446, 128).Trim();
     ApplicationIdentifier         = Encoding.ASCII.GetString(b, 574, 128).Trim();
     CopyrightFileIdentifier       = getencoding.GetString(b, 702, 36).Trim();
     AbstractFileIdentifier        = getencoding.GetString(b, 739, 36).Trim();
     BibliographicFileIdentifier   = getencoding.GetString(b, 776, 36).Trim();
     VolumeCreationDateandTime     = getDate(ToByteArray(b, 813, 16));
     VolumeModificationDateandTime = getDate(ToByteArray(b, 830, 16));
     VolumeExpirationDateandTime   = getDate(ToByteArray(b, 847, 16));
     VolumeEffectiveDateandTime    = getDate(ToByteArray(b, 864, 16));
     FileStructureVersion          = b[881];
 }
Ejemplo n.º 2
0
 public DirectoryRecord(byte[] buffer, int offset, Encoding enc, ISO9660 reader)
 {
     name        = "";
     fullname    = "";
     FileVersion = 0;
     directorys  = new Dictionary <string, DirectoryRecord>();
     files       = new Dictionary <string, DirectoryRecord>();
     checked
     {
         recordLength = buffer[0 + offset];
         if (recordLength > 0)
         {
             sectorsInExtendedRecord = buffer[1 + offset];
             firstDataSector         = BitConverter.ToUInt32(buffer, 2 + offset);
             dataLength = BitConverter.ToUInt32(buffer, 10 + offset);
             try
             {
                 DateTime dateTime  = new DateTime(1900 + unchecked ((int)buffer[checked (18 + offset)]), buffer[19 + offset], buffer[20 + offset], buffer[21 + offset], buffer[22 + offset], buffer[23 + offset]);
                 DateTime dateTime2 = dateTime;
                 RecordingDateAndTime = dateTime2.AddHours(4 *unchecked ((int)buffer[checked (24 + offset)]));
             }
             catch (Exception projectError)
             {
                 ProjectData.SetProjectError(projectError);
                 RecordingDateAndTime = DateTime.Now;
                 ProjectData.ClearProjectError();
             }
             unchecked
             {
                 flags = (FileFlags)buffer[checked (25 + offset)];
             }
             fileUnitSize  = buffer[26 + offset];
             interleaveGap = buffer[27 + offset];
             volSeqNumber  = BitConverter.ToUInt16(buffer, 28 + offset);
             nameLength    = buffer[32 + offset];
             if (nameLength == 1 && (buffer[33 + offset] == 0 || buffer[33 + offset] == 1))
             {
                 if (buffer[33 + offset] == 0)
                 {
                     name = ".";
                 }
                 else
                 {
                     name = "..";
                 }
             }
             else
             {
                 name = enc.GetString(buffer, 33 + offset, nameLength);
                 if (Strings.InStr(name, ";") != 0)
                 {
                     FileVersion = (byte)Conversions.ToInteger(Strings.Split(name, ";")[1]);
                     name        = Strings.Split(name, ";")[0];
                 }
             }
             isDirectory = Conversions.ToBoolean(Interaction.IIf(flags == FileFlags.Directory, true, false));
         }
         _Length        = dataLength;
         currentSector  = (int)firstDataSector;
         currentOffset  = 0L;
         sectorOffset   = 0;
         internalReader = reader;
         blocksize      = reader.Blocksize;
     }
 }