Пример #1
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);
            AllocationDescriptors = Utilities.ToByteArray(buffer, offset + 176 + ExtendedAttributesLength, AllocationDescriptorsLength);

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

            return (int)(176 + ExtendedAttributesLength + AllocationDescriptorsLength);
        }
Пример #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);
            AllocationDescriptors       = Utilities.ToByteArray(buffer, offset + 176 + ExtendedAttributesLength, AllocationDescriptorsLength);

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

            return((int)(176 + ExtendedAttributesLength + AllocationDescriptorsLength));
        }