SeekToEnd() public method

public SeekToEnd ( ) : void
return void
示例#1
0
        public FbxReader(BinaryReader reader)
        {
            reader.RequireMagic(Magic);
            Version = reader.ReadInt32();
            if (Version < MinimumSupportedVersion || Version > MaximumSupportedVersion)
                throw new InvalidDataException("Unsupported FBX version " + Version + "; supported versions are " + MinimumSupportedVersion + " to " + MaximumSupportedVersion + ".");

            FbxSection section;

            while ((section = new FbxSection(reader)).IsValid) {
                switch (section.Name) {
                    case FbxHeaderExtension.FbxFileTypeName:
                        new FbxHeaderExtension(section);
                        break;

                    case "FileId": // Seems to be a GUID in raw data.
                    case "CreationTime": // Same as in header.
                    case "Creator": // Same as in header.
                    case "GlobalSettings": // Don't care right now.
                        section.SeekToEnd();
                        break;

                    case "Documents":
                    case "References":
                    case "Definitions":
                        section.SeekToEnd();
                        break;

                    default:
                        throw new InvalidDataException("Unexpected root section '" + section.Name + "'.");
                }

                section.RequireEnd();
            }
        }
示例#2
0
文件: Fbx.cs 项目: layshua/Alexandria
        public FbxReader(BinaryReader reader)
        {
            reader.RequireMagic(Magic);
            Version = reader.ReadInt32();
            if (Version < MinimumSupportedVersion || Version > MaximumSupportedVersion)
            {
                throw new InvalidDataException("Unsupported FBX version " + Version + "; supported versions are " + MinimumSupportedVersion + " to " + MaximumSupportedVersion + ".");
            }

            FbxSection section;

            while ((section = new FbxSection(reader)).IsValid)
            {
                switch (section.Name)
                {
                case FbxHeaderExtension.FbxFileTypeName:
                    new FbxHeaderExtension(section);
                    break;

                case "FileId":                         // Seems to be a GUID in raw data.
                case "CreationTime":                   // Same as in header.
                case "Creator":                        // Same as in header.
                case "GlobalSettings":                 // Don't care right now.
                    section.SeekToEnd();
                    break;

                case "Documents":
                case "References":
                case "Definitions":
                    section.SeekToEnd();
                    break;


                default:
                    throw new InvalidDataException("Unexpected root section '" + section.Name + "'.");
                }

                section.RequireEnd();
            }
        }