Ejemplo n.º 1
0
        /// <summary>
        /// Writes the rtpdump file header
        /// </summary>
        public void WriteFileHeader(bool force = false)
        {
            //If not forcing and the header was already written then do nothing
            if (false == force && m_WroteHeader)
            {
                return;
            }

            //Header is only written in Binary files
            if (m_Format < FileFormat.Text)
            {
                //Create the file header now if null
                if (m_FileIdentifier == null)
                {
                    m_FileIdentifier = RtpDumpExtensions.CreateFileIdentifier(m_Source);
                }

                //Write the file header
                m_Writer.Write(m_FileIdentifier, 0, m_FileIdentifier.Length);

                if (m_FileHeader == null)
                {
                    m_FileHeader = RtpDumpExtensions.CreateFileHeader(m_Start, m_Source);
                }

                //Write the RD_hdr_t
                m_Writer.Write(m_FileHeader, 0, m_FileHeader.Length);
            }

            //We wrote the header...
            m_WroteHeader = true;
        }