本文整理汇总了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();
}
示例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();
}
示例3: LoadFromStream
protected override void LoadFromStream(Stream stream)
{
base.LoadFromStream(stream);
if (Version == 1) FragmentDuration = stream.ReadBEUInt64();
else FragmentDuration = (ulong)stream.ReadBEInt32();
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例8: ReadTimeStamp
public static DateTime ReadTimeStamp(Stream stream)
{
var nix = (long)stream.ReadBEUInt64();
return nix.FromMicrosecondsSinceUnixEpochStart();
}