WriteForward() public méthode

Write the given byte array in 0..n order
public WriteForward ( byte data ) : void
data byte
Résultat void
        /// <summary>
        /// Create a new SMIL container box. Please supply your own SMIL file.
        /// </summary>
        public SmoothSmil(byte[] SmilFile)
            : base("uuid")
        {
            _data = new System.IO.MemoryStream();
            BigEndianWriter ous = new BigEndianWriter(_data);

            // I have no idea what this GUID relates to or what it means.
            // I took this value from a socket capture. Many Bothans died to bring us this information.
            //Guid uuid_head = new Guid("A5 D4 0B 30 E8 14 11 DD BA 2F 08 00 20 0C 9A 66");
            ous.WriteForward(new byte[] { 0xA5, 0xD4, 0x0B, 0x30, 0xE8, 0x14, 0x11, 0xDD, 0xBA, 0x2F, 0x08, 0x00, 0x20, 0x0C, 0x9A, 0x66 });

            UInt32 blank = 0U;
            ous.Write(blank);
            ous.WriteForward(SmilFile);
        }
        /// <summary>
        /// Create a new timing box.
        /// </summary>
        /// <param name="Offset">Start timecode of this fragment (sum of previous 'FragmentTicks')</param>
        /// <param name="FragmentTicks">Total number of .Net ticks of the fragment</param>
        public SmoothFragmentTimer(long Offset, long FragmentTicks)
            : base("uuid")
        {
            _data = new System.IO.MemoryStream();
            BigEndianWriter ous = new BigEndianWriter(_data);

            // This is the GUID for the timing box. Taken directly from network captures
            ous.WriteForward(new byte[] {
                0x6D, 0x1D, 0x9B, 0x05, 0x42, 0xD5, 0x44, 0xE6,
                0x80, 0xE2, 0x14, 0x1D, 0xAF, 0xF7, 0x57, 0xB2 // 16 bytes of 'type'
            });

            // Don't know what this is, but it's always this data when I've seen it. Maybe flags&version?
            ous.WriteForward(new byte[] {
                0x01, 0x00, 0x00, 0x00
            });

            // This relates to the 't' field of the 'c' element in .ism files.
            ous.Write((UInt64)Offset); // This is presentation offset.

            // This relates to the 'd' field of the 'c' element in .ism files.
            ous.Write((UInt64)FragmentTicks); // This is the fragment duration.
        }
Exemple #3
0
        public dinf()
            : base("dinf")
        {
            _data = new System.IO.MemoryStream();
            BigEndianWriter ous = new BigEndianWriter(_data);

            byte[] minimum = new byte[] {
                0x00, 0x00, 0x00, 0x1C, 0x64, 0x72, 0x65, 0x66,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
                0x00, 0x00, 0x00, 0x0C, 0x75, 0x72, 0x6C, 0x20,
                0x00, 0x00, 0x00, 0x01
            }; // minimal dref>url (refers only to this file)

            ous.WriteForward(minimum);
        }
Exemple #4
0
        /// <summary>
        /// Output the header data for this Box.
        /// Override this to add extra data if your sub-class adds extra fields
        /// </summary>
        /// <returns></returns>
        protected virtual byte[] selfData()
        {
            ulong size = deepSize();
            MemoryStream ms = new MemoryStream();

            BigEndianWriter ous = new BigEndianWriter(ms);

            if (size >= UInt32.MaxValue) {
                ous.Write((UInt32)1U);
                ous.Write((UInt32)_fourCC);
                ous.Write((UInt64)size);
            } else {
                ous.Write((UInt32)size);
                ous.Write((UInt32)_fourCC);
            }
            if (_flags != null) ous.WriteForward(_flags);
            return ms.ToArray();
        }