当前位置: 首页>>代码示例>>C#>>正文


C# BinaryReaderEx类代码示例

本文整理汇总了C#中BinaryReaderEx的典型用法代码示例。如果您正苦于以下问题:C# BinaryReaderEx类的具体用法?C# BinaryReaderEx怎么用?C# BinaryReaderEx使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


BinaryReaderEx类属于命名空间,在下文中一共展示了BinaryReaderEx类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadSection

        public override void LoadSection(BinaryReaderEx reader)
        {
            base.LoadSection(reader);

            this.NumElements = reader.ReadInt32();
            reader.BaseStream.Seek(12, System.IO.SeekOrigin.Current); // Skip 12 bytes

            this.ElementOffsets = new List<ElementOffsetData>();

            for (var i = 0; i < this.NumElements; i++)
            {
                var thing = new ElementOffsetData();
                thing.BoneNameOffset = reader.ReadInt32();
                thing.NameOffset = reader.ReadInt32();
                thing.OffsetX = reader.ReadSingle();
                thing.OffsetY = reader.ReadSingle();
                thing.OffsetZ = reader.ReadSingle();
                thing.Unused1 = reader.ReadInt32();
                thing.Unused2 = reader.ReadInt32();
                thing.Unused3 = reader.ReadInt32();
                this.ElementOffsets.Add(thing);
            }

            foreach (var el in this.ElementOffsets)
            {
                reader.BaseStream.Position = this.SectionStart + el.BoneNameOffset;
                el.BoneName = reader.ReadNullTerminatedString();
                reader.BaseStream.Position = this.SectionStart + el.NameOffset;
                el.Name = reader.ReadNullTerminatedString();
            }
        }
开发者ID:nohbdy,项目名称:ffxivmodelviewer,代码行数:31,代码来源:ElbSection.cs

示例2: LoadSection

        public override void LoadSection(BinaryReaderEx reader)
        {
            base.LoadSection(reader);

            this.MotionInfoBlocks = new List<MotionInfoBlock>();
            int numMIBs = (this.SectionLength - 4) / bytesPerBlock;
            for (var i = 0; i < numMIBs; i++)
            {
                var mib = new MotionInfoBlock();
                mib.MotionName = reader.ReadFixedLengthString(16).Trim();
                mib.FrameCount = reader.ReadSByte();
                mib.CurveCoefficient = reader.ReadSByte();
                mib.InitialVelocity = reader.ReadSByte();
                mib.RollingFrameEnd = reader.ReadSByte();
                mib.CaseOfRightFootEnd = reader.ReadSByte();
                mib.CaseOfLeftFootEnd = reader.ReadSByte();
                mib.Unk1 = reader.ReadSByte();
                mib.Unk2 = reader.ReadSByte();
                mib.SubstituteMotionName = reader.ReadFixedLengthString(16).Trim();
                mib.SubstituteMotionStartFrame = reader.ReadSByte();
                mib.IdleFramesToBlend = reader.ReadSByte();
                mib.FrameStartingRotationStop = reader.ReadSByte();
                mib.EndsOnWhichFoot = reader.ReadSByte();
                mib.Unknown = reader.ReadInt16();

                this.MotionInfoBlocks.Add(mib);
            }
        }
开发者ID:nohbdy,项目名称:ffxivmodelviewer,代码行数:28,代码来源:CibmSection.cs

示例3: LoadData

        public override void LoadData(BinaryReaderEx reader)
        {
            base.LoadData(reader);

            this.String = reader.ReadNullTerminatedString(Encoding.ASCII);
            this.DisplayName = "STR";
        }
开发者ID:nohbdy,项目名称:ffxivmodelviewer,代码行数:7,代码来源:StringChunk.cs

示例4: ReadHeader

        private void ReadHeader(BinaryReaderEx reader)
        {
            this.Header = new DatDigger.Sound.AdpcmWaveFormat();
            this.Header.FormatTag = (SlimDX.Multimedia.WaveFormatTag)reader.ReadInt16();
            this.Header.Channels = reader.ReadInt16();
            this.Header.SamplesPerSecond = reader.ReadInt32();
            this.Header.AverageBytesPerSecond = reader.ReadInt32();
            this.Header.BlockAlignment = reader.ReadInt16();
            this.Header.BitsPerSample = reader.ReadInt16();
            short cbSize = reader.ReadInt16();
            if (cbSize != 0x20)
            {
                throw new InvalidOperationException(String.Format("Unexpected value for ADPCMWAVEFORMAT cbSize 0x{0}.  Expected 0x20", cbSize));
            }

            this.Header.SamplesPerBlock = reader.ReadInt16();
            this.Header.NumCoef = reader.ReadInt16();
            this.Header.Coefficients = new List<DatDigger.Sound.AdpcmCoefficient>(this.Header.NumCoef);
            for (var i = 0; i < this.Header.NumCoef; i++)
            {
                DatDigger.Sound.AdpcmCoefficient coef = new DatDigger.Sound.AdpcmCoefficient();
                coef.A = reader.ReadInt16();
                coef.B = reader.ReadInt16();
                this.Header.Coefficients.Add(coef);
            }
        }
开发者ID:nohbdy,项目名称:ffxivmodelviewer,代码行数:26,代码来源:AdpcmWave.cs

示例5: LoadSection

        public override void LoadSection(BinaryReaderEx reader)
        {
            base.LoadSection(reader);

            this.baseChunk = ChunkLoader.LoadChunk(SectionType.wrb, reader, this);
            this.Children = new List<INavigable>();
            this.Children.Add(baseChunk);
        }
开发者ID:nohbdy,项目名称:ffxivmodelviewer,代码行数:8,代码来源:ModelSection.cs

示例6: LoadSection

        public override void LoadSection(BinaryReaderEx reader)
        {
            base.LoadSection(reader);

            this.LoadHeader(reader);
            this.LoadStringTable(reader);
            this.LoadBones(reader);
        }
开发者ID:nohbdy,项目名称:ffxivmodelviewer,代码行数:8,代码来源:SkeletonSection.cs

示例7: LoadFile

        public void LoadFile(BinaryReaderEx reader)
        {
            reader.BaseStream.Seek(8, System.IO.SeekOrigin.Begin);

            this.ReadEncodedData(reader);
            this.DecodeData();

            this.Contents = Encoding.UTF8.GetString(this.decodedData);
        }
开发者ID:nohbdy,项目名称:ffxivmodelviewer,代码行数:9,代码来源:SqexFile.cs

示例8: LoadData

        public void LoadData(BinaryReaderEx reader)
        {
            reader.ReadInt32(); // Remove PWIB bytes
            this.FileSize = reader.ReadUInt32(Endianness.BigEndian);
            this.Unknown = reader.ReadInt32(Endianness.BigEndian);
            this.DataOffset = reader.ReadUInt32(Endianness.BigEndian);

            this.LoadSection(reader);
        }
开发者ID:nohbdy,项目名称:ffxivmodelviewer,代码行数:9,代码来源:PwibSection.cs

示例9: LoadData

        public void LoadData(BinaryReaderEx reader)
        {
            long pos = reader.BaseStream.Position;

            BuildFormat();

            reader.BaseStream.Position = pos + this.WaveHeader.FormatHeaderLength;
            this.WaveData = reader.ReadBytes(this.WaveHeader.DataLength);
        }
开发者ID:nohbdy,项目名称:ffxivmodelviewer,代码行数:9,代码来源:PcmWave.cs

示例10: LoadSection

        public override void LoadSection(BinaryReaderEx reader)
        {
            base.LoadSection(reader);

            this.LoadHeader(reader);
            this.LoadResourceTypes(reader);
            this.LoadResourceIds(reader);
            this.LoadStringTable(reader);
            this.LoadResources(reader);
        }
开发者ID:nohbdy,项目名称:ffxivmodelviewer,代码行数:10,代码来源:ResourceSection.cs

示例11: LoadData

        public virtual void LoadData(BinaryReaderEx reader)
        {
            this.ChunkStart = reader.BaseStream.Position;

            this.ChunkHeader = new ChunkHeader();
            this.ChunkHeader.ChunkType = reader.ReadInt32();
            this.ChunkHeader.Unknown1 = reader.ReadInt32(Endianness.BigEndian);
            this.ChunkHeader.DataSize = reader.ReadInt32(Endianness.BigEndian);
            this.ChunkHeader.NextChunkOffset = reader.ReadInt32(Endianness.BigEndian);
        }
开发者ID:nohbdy,项目名称:ffxivmodelviewer,代码行数:10,代码来源:Chunk.cs

示例12: LoadSection

        public virtual void LoadSection(BinaryReaderEx reader)
        {
            this.SectionStart = reader.BaseStream.Position;

            this.SectionHeader = new SectionHeader();
            this.SectionHeader.Magic = reader.ReadInt64();
            this.SectionHeader.Version = reader.ReadInt32();
            this.SectionHeader.Unknown2 = reader.ReadInt32();
            this.SectionHeader.SectionLength = reader.ReadInt32();
            this.SectionHeader.Junk = reader.ReadBytes(28);
        }
开发者ID:nohbdy,项目名称:ffxivmodelviewer,代码行数:11,代码来源:SectionBase.cs

示例13: LoadSection

        public override void LoadSection(BinaryReaderEx reader)
        {
            base.LoadSection(reader);

            this.Strings = new List<string>();
            int numStrings = (this.SectionLength - 4) / bytesPerBlock;
            for (var i = 0; i < numStrings; i++)
            {
                this.Strings.Add(reader.ReadFixedLengthString(16).Trim());
            }
        }
开发者ID:nohbdy,项目名称:ffxivmodelviewer,代码行数:11,代码来源:CibcSection.cs

示例14: LoadHeader

        private void LoadHeader(BinaryReaderEx reader)
        {
            // Load Header
            this.ResourceHeader = new ResourceHeader();
            this.ResourceHeader.NumResources = reader.ReadInt32();
            this.ResourceHeader.StringTableOffset = reader.ReadInt32();
            this.ResourceHeader.NumStrings = reader.ReadInt32();
            this.ResourceHeader.ResourceType = (SectionType)reader.ReadInt32();

            this.LoadResourceInfo(reader);
        }
开发者ID:nohbdy,项目名称:ffxivmodelviewer,代码行数:11,代码来源:ResourceSection.cs

示例15: LoadData

        public override void LoadData(BinaryReaderEx reader)
        {
            base.LoadData(reader);

            this.boundingBox.Minimum.X = reader.ReadSingle(Endianness.BigEndian);
            this.boundingBox.Minimum.Y = reader.ReadSingle(Endianness.BigEndian);
            this.boundingBox.Minimum.Z = reader.ReadSingle(Endianness.BigEndian);
            this.boundingBox.Maximum.X = reader.ReadSingle(Endianness.BigEndian);
            this.boundingBox.Maximum.Y = reader.ReadSingle(Endianness.BigEndian);
            this.boundingBox.Maximum.Z = reader.ReadSingle(Endianness.BigEndian);

            this.DisplayName = "AABB";
        }
开发者ID:nohbdy,项目名称:ffxivmodelviewer,代码行数:13,代码来源:BoundingBoxChunk.cs


注:本文中的BinaryReaderEx类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。