public override int Parse(byte[] buffer, int offset)
        {
            VolumeDescriptorSequenceNumber = EndianUtilities.ToUInt32LittleEndian(buffer, offset + 16);
            PrimaryVolumeDescriptorNumber  = EndianUtilities.ToUInt32LittleEndian(buffer, offset + 20);
            VolumeIdentifier       = UdfUtilities.ReadDString(buffer, offset + 24, 32);
            VolumeSequenceNumber   = EndianUtilities.ToUInt16LittleEndian(buffer, offset + 56);
            MaxVolumeSquenceNumber = EndianUtilities.ToUInt16LittleEndian(buffer, offset + 58);
            InterchangeLevel       = EndianUtilities.ToUInt16LittleEndian(buffer, offset + 60);
            MaxInterchangeLevel    = EndianUtilities.ToUInt16LittleEndian(buffer, offset + 62);
            CharacterSetList       = EndianUtilities.ToUInt32LittleEndian(buffer, offset + 64);
            MaxCharacterSetList    = EndianUtilities.ToUInt32LittleEndian(buffer, offset + 68);
            VolumeSetIdentifier    = UdfUtilities.ReadDString(buffer, offset + 72, 128);
            DescriptorCharSet      = EndianUtilities.ToStruct <CharacterSetSpecification>(buffer, offset + 200);
            ExplanatoryCharSet     = EndianUtilities.ToStruct <CharacterSetSpecification>(buffer, offset + 264);
            VolumeAbstractExtent   = new ExtentDescriptor();
            VolumeAbstractExtent.ReadFrom(buffer, offset + 328);
            VolumeCopyrightNoticeExtent = new ExtentDescriptor();
            VolumeCopyrightNoticeExtent.ReadFrom(buffer, offset + 336);
            ApplicationIdentifier    = EndianUtilities.ToStruct <ApplicationEntityIdentifier>(buffer, offset + 344);
            RecordingTime            = UdfUtilities.ParseTimestamp(buffer, offset + 376);
            ImplementationIdentifier = EndianUtilities.ToStruct <ImplementationEntityIdentifier>(buffer, offset + 388);
            ImplementationUse        = EndianUtilities.ToByteArray(buffer, offset + 420, 64);
            PredecessorVolumeDescriptorSequenceLocation = EndianUtilities.ToUInt32LittleEndian(buffer, offset + 484);
            Flags = EndianUtilities.ToUInt16LittleEndian(buffer, offset + 488);

            return(512);
        }
Beispiel #2
0
        public virtual int ReadFrom(byte[] buffer, int offset)
        {
            DescriptorTag           = Utilities.ToStruct <DescriptorTag>(buffer, offset);
            InformationControlBlock = Utilities.ToStruct <InformationControlBlock>(buffer, offset + 16);
            Uid                         = Utilities.ToUInt32LittleEndian(buffer, offset + 36);
            Gid                         = Utilities.ToUInt32LittleEndian(buffer, offset + 40);
            Permissions                 = (FilePermissions)Utilities.ToUInt32LittleEndian(buffer, offset + 44);
            FileLinkCount               = Utilities.ToUInt16LittleEndian(buffer, offset + 48);
            RecordFormat                = buffer[offset + 50];
            RecordDisplayAttributes     = buffer[offset + 51];
            RecordLength                = Utilities.ToUInt16LittleEndian(buffer, offset + 52);
            InformationLength           = Utilities.ToUInt64LittleEndian(buffer, offset + 56);
            LogicalBlocksRecorded       = Utilities.ToUInt64LittleEndian(buffer, offset + 64);
            AccessTime                  = UdfUtilities.ParseTimestamp(buffer, offset + 72);
            ModificationTime            = UdfUtilities.ParseTimestamp(buffer, offset + 84);
            AttributeTime               = UdfUtilities.ParseTimestamp(buffer, offset + 96);
            Checkpoint                  = Utilities.ToUInt32LittleEndian(buffer, offset + 108);
            ExtendedAttributeIcb        = Utilities.ToStruct <LongAllocationDescriptor>(buffer, offset + 112);
            ImplementationIdentifier    = Utilities.ToStruct <ImplementationEntityIdentifier>(buffer, offset + 128);
            UniqueId                    = Utilities.ToUInt64LittleEndian(buffer, offset + 160);
            ExtendedAttributesLength    = Utilities.ToInt32LittleEndian(buffer, offset + 168);
            AllocationDescriptorsLength = Utilities.ToInt32LittleEndian(buffer, offset + 172);
            ExtendedAttributes          = Utilities.ToByteArray(buffer, offset + 176, ExtendedAttributesLength);
            AllocationDescriptors       = Utilities.ToByteArray(buffer, offset + 176 + ExtendedAttributesLength, AllocationDescriptorsLength);

            return((int)(176 + ExtendedAttributesLength + AllocationDescriptorsLength));
        }
Beispiel #3
0
        public override int ReadFrom(byte[] buffer, int offset)
        {
            DescriptorTag           = Utilities.ToStruct <DescriptorTag>(buffer, offset);
            InformationControlBlock = Utilities.ToStruct <InformationControlBlock>(buffer, offset + 16);
            Uid                         = Utilities.ToUInt32LittleEndian(buffer, offset + 36);
            Gid                         = Utilities.ToUInt32LittleEndian(buffer, offset + 40);
            Permissions                 = (FilePermissions)Utilities.ToUInt32LittleEndian(buffer, offset + 44);
            FileLinkCount               = Utilities.ToUInt16LittleEndian(buffer, offset + 48);
            RecordFormat                = buffer[offset + 50];
            RecordDisplayAttributes     = buffer[offset + 51];
            RecordLength                = Utilities.ToUInt16LittleEndian(buffer, offset + 52);
            InformationLength           = Utilities.ToUInt64LittleEndian(buffer, offset + 56);
            ObjectSize                  = Utilities.ToUInt64LittleEndian(buffer, offset + 64);
            LogicalBlocksRecorded       = Utilities.ToUInt64LittleEndian(buffer, offset + 72);
            AccessTime                  = UdfUtilities.ParseTimestamp(buffer, offset + 80);
            ModificationTime            = UdfUtilities.ParseTimestamp(buffer, offset + 92);
            CreationTime                = UdfUtilities.ParseTimestamp(buffer, offset + 104);
            AttributeTime               = UdfUtilities.ParseTimestamp(buffer, offset + 116);
            Checkpoint                  = Utilities.ToUInt32LittleEndian(buffer, offset + 128);
            ExtendedAttributeIcb        = Utilities.ToStruct <LongAllocationDescriptor>(buffer, offset + 136);
            StreamDirectoryIcb          = Utilities.ToStruct <LongAllocationDescriptor>(buffer, offset + 152);
            ImplementationIdentifier    = Utilities.ToStruct <ImplementationEntityIdentifier>(buffer, offset + 168);
            UniqueId                    = Utilities.ToUInt64LittleEndian(buffer, offset + 200);
            ExtendedAttributesLength    = Utilities.ToInt32LittleEndian(buffer, offset + 208);
            AllocationDescriptorsLength = Utilities.ToInt32LittleEndian(buffer, offset + 212);
            AllocationDescriptors       = Utilities.ToByteArray(buffer, offset + 216 + ExtendedAttributesLength,
                                                                AllocationDescriptorsLength);

            byte[] eaData = Utilities.ToByteArray(buffer, offset + 216, ExtendedAttributesLength);
            ExtendedAttributes = ReadExtendedAttributes(eaData);

            return(216 + ExtendedAttributesLength + AllocationDescriptorsLength);
        }
        public int ReadFrom(byte[] buffer, int offset)
        {
            DescriptorTag                  = Utilities.ToStruct <DescriptorTag>(buffer, offset);
            RecordingTime                  = UdfUtilities.ParseTimestamp(buffer, offset + 16);
            InterchangeLevel               = Utilities.ToUInt16LittleEndian(buffer, offset + 28);
            MaximumInterchangeLevel        = Utilities.ToUInt16LittleEndian(buffer, offset + 30);
            CharacterSetList               = Utilities.ToUInt32LittleEndian(buffer, offset + 32);
            MaximumCharacterSetList        = Utilities.ToUInt32LittleEndian(buffer, offset + 36);
            FileSetNumber                  = Utilities.ToUInt32LittleEndian(buffer, offset + 40);
            FileSetDescriptorNumber        = Utilities.ToUInt32LittleEndian(buffer, offset + 44);
            LogicalVolumeIdentifierCharset = Utilities.ToStruct <CharacterSetSpecification>(buffer, offset + 48);
            LogicalVolumeIdentifier        = UdfUtilities.ReadDString(buffer, offset + 112, 128);
            FileSetCharset                 = Utilities.ToStruct <CharacterSetSpecification>(buffer, offset + 240);
            FileSetIdentifier              = UdfUtilities.ReadDString(buffer, offset + 304, 32);
            CopyrightFileIdentifier        = UdfUtilities.ReadDString(buffer, offset + 336, 32);
            AbstractFileIdentifier         = UdfUtilities.ReadDString(buffer, offset + 368, 32);
            RootDirectoryIcb               = Utilities.ToStruct <LongAllocationDescriptor>(buffer, offset + 400);
            DomainIdentifier               = Utilities.ToStruct <DomainEntityIdentifier>(buffer, offset + 416);
            NextExtent = Utilities.ToStruct <LongAllocationDescriptor>(buffer, offset + 448);
            SystemStreamDirectoryIcb = Utilities.ToStruct <LongAllocationDescriptor>(buffer, offset + 464);

            return(512);
        }