CSharpRTMP.Common.MediaFile.WriteFlvTag C# (CSharp) Method

WriteFlvTag() public method

public WriteFlvTag ( MemoryStream pData, int timestamp, bool isAudio ) : void
pData System.IO.MemoryStream
timestamp int
isAudio bool
return void
        public void WriteFlvTag(MemoryStream pData,int timestamp,bool isAudio)
        {
            lock (this)
            {
                var totalLength = (int)(pData?.Length ?? 0);
                Bw.Write(isAudio ? (byte)8 : (byte)9);
                Bw.Write24(totalLength);
                Bw.WriteS32(timestamp);
                Bw.Write24(0);
                if (totalLength > 0)
                {
                    pData.WriteTo(DataStream);
                    pData.SetLength(0);
                }
                Bw.Write(totalLength + 11);
            }
        }
        public bool ReadBuffer(byte[] pBuffer, int offset = 0, int count = 0)