本文整理汇总了C#中BufferChunk.NextBufferChunk方法的典型用法代码示例。如果您正苦于以下问题:C# BufferChunk.NextBufferChunk方法的具体用法?C# BufferChunk.NextBufferChunk怎么用?C# BufferChunk.NextBufferChunk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BufferChunk
的用法示例。
在下文中一共展示了BufferChunk.NextBufferChunk方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadDataFromBuffer
/// <summary>
/// Converts buffer into member data
/// </summary>
/// <param name="packet"></param>
public override void ReadDataFromBuffer(BufferChunk buffer)
{
// Read SSRCs
for(int i = 0; i < Header.ItemCount; i++)
{
ssrcs.Add(buffer.NextUInt32());
}
// Determine if there is a reason...
// SSRCs are 32 bits each, Length is number of 32 bit words in packet data
if(Header.Length > Header.ItemCount)
{
reason = (byte[])buffer.NextBufferChunk(buffer.NextByte());
}
}
示例2: RtcpPacket
/// <summary>
/// Constructor which creates a generic RtcpPacket from an existing buffer
/// </summary>
/// <param name="buffer"></param>
public RtcpPacket(BufferChunk buffer)
{
header = new RtcpHeader(buffer.NextBufferChunk(RtcpHeader.SIZE));
this.buffer = buffer.NextBufferChunk(Header.Length * 4);
}
示例3: RemovePadding
/// <summary>
/// Removes padding to make sure buffer ends on a 32 bit boundary
/// </summary>
/// <param name="cbBuffer">Size of buffer in bytes</param>
protected static void RemovePadding(BufferChunk buffer)
{
int padding = buffer.Length % 4;
if(padding > 0)
{
buffer.NextBufferChunk(padding);
}
}
示例4: ReadPrivatePropertyFromBuffer
private void ReadPrivatePropertyFromBuffer(BufferChunk buffer)
{
byte totalLength = buffer.NextByte();
byte prefixLength = buffer.NextByte();
int dataLength = totalLength - prefixLength - 1;
// The cast to byte[] does a copy
byte[] prefix = (byte[])buffer.NextBufferChunk(prefixLength);
byte[] data = null;
if(dataLength > 0)
{
// The cast to byte[] does a copy
data = (byte[])buffer.NextBufferChunk(dataLength);
}
privs[prefix] = data;
}
示例5: ReadPropertyFromBuffer
private void ReadPropertyFromBuffer(int type, BufferChunk buffer)
{
int dataLength = buffer.NextByte();
if(dataLength != 0)
{
data[type] = (byte[])buffer.NextBufferChunk(dataLength);
}
else // Clear value
{
data[type] = null;
}
}
示例6: ReadDataFromBuffer
public void ReadDataFromBuffer(BufferChunk buffer)
{
SSRC = buffer.NextUInt32();
FractionLost = buffer.NextByte();
PacketsLost = ThreeBytesToInt(buffer.NextBufferChunk(3));
ExtendedHighestSequence = buffer.NextUInt32();
Jitter = buffer.NextUInt32();
LastSenderReport = buffer.NextUInt32();
DelaySinceLastSenderReport = buffer.NextUInt32();
}