forked from kthompson/RtpLib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RtcpUnknown.cs
63 lines (49 loc) · 1.36 KB
/
RtcpUnknown.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Net;
namespace RtpLib
{
public class RtcpUnknown : RtcpPacket
{
#region Public Methods
public override void ParseData(Stream stream)
{
MemoryStream ms = new MemoryStream();
stream.CopyTo(ms);
this.Data = ms.GetBuffer();
}
protected override int GetByteCount()
{
return this.Data.Length;
}
protected override void ToStreamInternal(Stream stream)
{
stream.Write(this.Data, 0, this.Data.Length);
}
#endregion
#region Properties
public override Rtcp.PacketType PacketType
{
get { return Rtcp.PacketType.Unknown; }
}
public byte[] Data
{
get;
set;
}
#endregion
#region ICloneable Implementation
public override object Clone()
{
var packet = this.MemberwiseClone() as RtcpUnknown;
packet.Header = packet.Header.Clone() as RtcpHeader;
packet.Data = new byte[this.Data.Length];
this.Data.CopyTo(packet.Data, 0);
return packet;
}
#endregion
}
}