PeerCastStation.FLV.RTMP.RTMPPlayConnection.PostContent C# (CSharp) Method

PostContent() private method

private PostContent ( Content content ) : void
content Content
return void
		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;
			}
		}