public void DownloadControl(DownloadControlCode code, byte[] buffer) { using (MemoryStream ms = new MemoryStream()) { PacketBase.WriteBytes(ms, (int)code); PacketBase.WriteBytes(ms, buffer); Send((int)ParamCode.DownloadControl, ms.ToArray()); } }
public static byte[] Encode(UniviewHeaderPacket packet) { using (MemoryStream ms = new MemoryStream()) { PacketBase.WriteBytes(ms, (int)VideoType.Uniview); PacketBase.WriteBytes(ms, packet.StreamId); PacketBase.WriteBytes(ms, packet.StreamName); PacketBase.WriteBytes(ms, packet.StreamUrl); return(ms.ToArray()); } }
public static byte[] Encode(UniviewStreamPacket data) { using (MemoryStream ms = new MemoryStream()) { PacketBase.WriteBytes(ms, data.Time); PacketBase.WriteBytes(ms, (int)data.Type); PacketBase.WriteBytes(ms, data.DecodeTag); PacketBase.WriteBytes(ms, data.Buffer.Length); PacketBase.WriteBytes(ms, data.Buffer); return(ms.ToArray()); } }