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


C# Stream.ReadBEUInt64方法代码示例

本文整理汇总了C#中Stream.ReadBEUInt64方法的典型用法代码示例。如果您正苦于以下问题:C# Stream.ReadBEUInt64方法的具体用法?C# Stream.ReadBEUInt64怎么用?C# Stream.ReadBEUInt64使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Stream的用法示例。


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

示例1: LoadFromStream

        protected override void LoadFromStream(Stream stream)
        {
            base.LoadFromStream(stream);

            if (Version == 1)
            {
                CreationTime = MovieHeaderBox.Convert1904Time(stream.ReadBEUInt64());
                ModificationTime = MovieHeaderBox.Convert1904Time(stream.ReadBEUInt64());
                TrackID = stream.ReadBEUInt32();
                _Reserved1 = stream.ReadBEUInt32();
                Duration = stream.ReadBEUInt64();
            }
            else // if (Version == 0)
            {
                CreationTime = MovieHeaderBox.Convert1904Time(stream.ReadBEUInt32());
                ModificationTime = MovieHeaderBox.Convert1904Time(stream.ReadBEUInt32());
                TrackID = stream.ReadBEUInt32();
                _Reserved1 = stream.ReadBEUInt32();
                Duration = stream.ReadBEUInt32();
            }
            for (int i = 0; i < 2; i++) _Reserved2[0] = stream.ReadBEUInt32();
            Layer = stream.ReadBEInt16();
            AlternateGroup = stream.ReadBEInt16();
            Volume = stream.ReadBEInt16();
            _Reserved3 = stream.ReadBEUInt16();
            for (int i = 0; i < 9; i++) _Matrix[i] = stream.ReadBEInt32();
            Width = stream.ReadBEUInt32();
            Height = stream.ReadBEUInt32();
        }
开发者ID:heksesang,项目名称:bmff,代码行数:29,代码来源:TrackHeaderBox.cs

示例2: LoadFromStream

        protected override void LoadFromStream(Stream stream)
        {
            base.LoadFromStream(stream);

            if (Version == 1)
            {
                _CreationTime = stream.ReadBEUInt64();
                _ModificationTime = stream.ReadBEUInt64();
                TimeScale = stream.ReadBEUInt32();
                Duration = stream.ReadBEUInt64();
            }
            else // if(Version == 0)
            {
                _CreationTime = stream.ReadBEUInt32();
                _ModificationTime = stream.ReadBEUInt32();
                TimeScale = stream.ReadBEUInt32();
                Duration = stream.ReadBEUInt32();
            }
            _Rate = stream.ReadBEInt32();
            _Volume = stream.ReadBEInt16();
            Reserved = stream.ReadBytes(2 + (2 * 4));
            for (int i = 0; i < 9; i++) Matrix[i] = stream.ReadBEInt32();
            PreDefined = stream.ReadBytes(6 * 4);
            NextTrackID = stream.ReadBEUInt32();
        }
开发者ID:heksesang,项目名称:bmff,代码行数:25,代码来源:MovieHeaderBox.cs

示例3: LoadFromStream

        protected override void LoadFromStream(Stream stream)
        {
            base.LoadFromStream(stream);

            if (Version == 1) FragmentDuration = stream.ReadBEUInt64();
            else FragmentDuration = (ulong)stream.ReadBEInt32();
        }
开发者ID:heksesang,项目名称:bmff,代码行数:7,代码来源:MovieExtendsHeaderBox.cs

示例4: LoadFromStream

        protected override void LoadFromStream(Stream stream)
        {
            base.LoadFromStream(stream);

            if (Version == 1)
            {
                CreationTime = MovieHeaderBox.Convert1904Time(stream.ReadBEUInt64());
                ModificationTime = MovieHeaderBox.Convert1904Time(stream.ReadBEUInt64());
                TimeScale = stream.ReadBEUInt32();
                Duration = stream.ReadBEUInt64();
            }
            else // if (Version == 0)
            {
                CreationTime = MovieHeaderBox.Convert1904Time(stream.ReadBEUInt32());
                ModificationTime = MovieHeaderBox.Convert1904Time(stream.ReadBEUInt32());
                TimeScale = stream.ReadBEUInt32();
                Duration = stream.ReadBEUInt32();
            }

            Language = ConvertThreeLetterLanguageCode(stream.ReadBEUInt16());
            Predefined = stream.ReadBEUInt16();
        }
开发者ID:heksesang,项目名称:bmff,代码行数:22,代码来源:MediaHeaderBox.cs

示例5: LoadFromStream

        protected override void LoadFromStream(Stream stream)
        {
            base.LoadFromStream(stream);

            TrackID = stream.ReadBEUInt32();

            if ((Flags & TrackFragmentFlags.BaseDataOffsetPresent) == TrackFragmentFlags.BaseDataOffsetPresent)
                BaseDataOffset = stream.ReadBEUInt64();
            if ((Flags & TrackFragmentFlags.SampleDrescriptionIndexPresent) == TrackFragmentFlags.SampleDrescriptionIndexPresent)
                SampleDescriptionIndex = stream.ReadBEUInt32();
            if ((Flags & TrackFragmentFlags.DefaultSampleDurationPresent) == TrackFragmentFlags.DefaultSampleDurationPresent)
                DefaultSampleDuration = stream.ReadBEUInt32();
            if ((Flags & TrackFragmentFlags.DefaultSampleSizePresent) == TrackFragmentFlags.DefaultSampleSizePresent)
                DefaultSampleSize = stream.ReadBEUInt32();
            if ((Flags & TrackFragmentFlags.DefaultSampleFlagsPresent) == TrackFragmentFlags.DefaultSampleFlagsPresent)
                DefaultSampleFlags = new SampleFlags(stream.ReadBEUInt32());

            if ((Flags & TrackFragmentFlags.DurationIsEmpty) == TrackFragmentFlags.DurationIsEmpty)
                DurationIsEmpty = true;
        }
开发者ID:heksesang,项目名称:bmff,代码行数:20,代码来源:TrackFragmentHeaderBox.cs

示例6: WireFrame

            /// <summary>
            /// Reconstruct (deserializes) frame from the stream. May throw on error
            /// </summary>
            public WireFrame(Stream stream) : this()
            {
                //MAGIC
                var magic = stream.ReadBEUShort();
                if (magic != MAGIC)
                    throw new ProtocolException(
                                StringConsts.GLUE_BAD_PROTOCOL_FRAME_ERROR + "bag magic: expected '{0}' but got '{1}'".Args(MAGIC, magic));
                
                //VERSION
                var ver = stream.ReadByte();
                if (ver != VERSION) 
                    throw new ProtocolException(
                                StringConsts.GLUE_BAD_PROTOCOL_FRAME_ERROR + "version mismatch: expected '{0}' but got '{1}'".Args(VERSION, ver));
                //TYPE
                m_Type  = (FrameType)stream.ReadByte();

                //FORMAT 
                m_Format = stream.ReadBEInt32();
                
                //ONEWAY
                m_OneWay = stream.ReadByte() != 0;

                //REQUESTID
                m_RequestID = new FID( stream.ReadBEUInt64() );

                //HEADERSCONTENT
                var len = stream.ReadBEInt32();
                if (len>0)
                {
                    if (len>MAX_HEADERS_BYTE_LENGTH) 
                       throw new ProtocolException(
                                StringConsts.GLUE_BAD_PROTOCOL_FRAME_ERROR + "arrived headers length of {0} bytes exceeds the limit of {1} bytes".Args(len, MAX_HEADERS_BYTE_LENGTH)); 
                   
                    m_HeadersContentLength = len;
                    
                    var hbuf = new byte[len];
                    stream.Read(hbuf, 0, len);
                    m_HeadersContent = HEADERS_ENCODING.GetString( hbuf );
                }

                m_Length = FRAME_LENGTH + m_HeadersContentLength;
            }
开发者ID:vlapchenko,项目名称:nfx,代码行数:45,代码来源:WireData.cs

示例7: TryReadPageHeader

 public static PageHeaderReadStatus TryReadPageHeader(Stream stream, ref DateTime current)
 {
     try
       {
     var h = stream.ReadBEUInt64();
     if (h!=PAGE_HEADER) return PageHeaderReadStatus.Corruption;
     var nix = (long)stream.ReadBEUInt64();
     var sts = nix.FromMicrosecondsSinceUnixEpochStart();
     if (sts<current) return PageHeaderReadStatus.Corruption;
     current = sts;
       }
       catch
       {
     return PageHeaderReadStatus.EOF;
       }
       return PageHeaderReadStatus.OK;
 }
开发者ID:itadapter,项目名称:nfx,代码行数:17,代码来源:Format.cs

示例8: ReadTimeStamp

 public static DateTime ReadTimeStamp(Stream stream)
 {
     var nix = (long)stream.ReadBEUInt64();
       return nix.FromMicrosecondsSinceUnixEpochStart();
 }
开发者ID:itadapter,项目名称:nfx,代码行数:5,代码来源:Format.cs


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