Inheritance: DiscUtils.Iso9660.SystemUseEntry
        private ContinuationSystemUseEntry Parse(IsoContext context, byte[] data, int offset)
        {
            ContinuationSystemUseEntry contEntry = null;
            SuspExtension extension = null;

            if (context.SuspExtensions != null && context.SuspExtensions.Count > 0)
            {
                extension = context.SuspExtensions[0];
            }

            int pos = offset;

            while (data.Length - pos > 4)
            {
                int            len;
                SystemUseEntry entry = SystemUseEntry.Parse(data, pos, context.VolumeDescriptor.CharacterEncoding, extension, out len);
                pos += len;

                if (entry == null)
                {
                    // Skip if unknown
                    continue;
                }

                switch (entry.Name)
                {
                case "ST":
                    // Abort
                    return(contEntry);

                case "CE":
                    contEntry = (ContinuationSystemUseEntry)entry;
                    break;

                case "ES":
                    ExtensionSelectSystemUseEntry esEntry = (ExtensionSelectSystemUseEntry)entry;
                    extension = context.SuspExtensions[esEntry.SelectedExtension];
                    break;

                case "PD":
                    break;

                case "SP":
                case "ER":
                    StoreEntry(null, entry);
                    break;

                default:
                    StoreEntry(extension, entry);
                    break;
                }
            }

            return(contEntry);
        }
示例#2
0
        private ContinuationSystemUseEntry Parse(IsoContext context, byte[] data, int offset)
        {
            ContinuationSystemUseEntry contEntry = null;
            SuspExtension extension = null;

            if (context.SuspExtensions != null && context.SuspExtensions.Count > 0)
            {
                extension = context.SuspExtensions[0];
            }

            int pos = offset;

            while (data.Length - pos > 4)
            {
                byte           len;
                SystemUseEntry entry = SystemUseEntry.Parse(data, pos, context.VolumeDescriptor.CharacterEncoding,
                                                            extension, out len);
                pos += len;

                if (entry == null)
                {
                    // A null entry indicates SUSP parsing must terminate.
                    // This will occur if a termination record is found,
                    // or if there is a problem with the SUSP data.
                    return(contEntry);
                }

                switch (entry.Name)
                {
                case "CE":
                    contEntry = (ContinuationSystemUseEntry)entry;
                    break;

                case "ES":
                    ExtensionSelectSystemUseEntry esEntry = (ExtensionSelectSystemUseEntry)entry;
                    extension = context.SuspExtensions[esEntry.SelectedExtension];
                    break;

                case "PD":
                    break;

                case "SP":
                case "ER":
                    StoreEntry(null, entry);
                    break;

                default:
                    StoreEntry(extension, entry);
                    break;
                }
            }

            return(contEntry);
        }