當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。