示例#1
0
        private void PostContent(Content content)
        {
            var pos = contentBuffer.Position;

            contentBuffer.Seek(0, System.IO.SeekOrigin.End);
            contentBuffer.Write(content.Data, 0, content.Data.Length);
            contentBuffer.Position = pos;
            if (contentSink == null)
            {
                contentSink = new RTMPContentSink(this);
            }
            fileParser.Read(contentBuffer, contentSink);
            if (contentBuffer.Position != 0)
            {
                var new_buf  = new System.IO.MemoryStream();
                var trim_pos = contentBuffer.Position;
                contentBuffer.Close();
                var buf = contentBuffer.ToArray();
                new_buf.Write(buf, (int)trim_pos, (int)(buf.Length - trim_pos));
                new_buf.Position = 0;
                contentBuffer    = new_buf;
            }
        }
		private void PostContent(Content content)
		{
			var pos = contentBuffer.Position;
			contentBuffer.Seek(0, System.IO.SeekOrigin.End);
			contentBuffer.Write(content.Data, 0, content.Data.Length);
			contentBuffer.Position = pos;
			if (contentSink==null) contentSink = new RTMPContentSink(this);
			fileParser.Read(contentBuffer, contentSink);
			if (contentBuffer.Position!=0) {
				var new_buf = new System.IO.MemoryStream();
				var trim_pos = contentBuffer.Position;
				contentBuffer.Close();
				var buf = contentBuffer.ToArray();
				new_buf.Write(buf, (int)trim_pos, (int)(buf.Length-trim_pos));
				new_buf.Position = 0;
				contentBuffer = new_buf;
			}
		}