RTMP.FlvTag.Load C# (CSharp) Method

Load() public method

public Load ( EndianBinaryReader reader ) : void
reader EndianBinaryReader
return void
        public void Load(EndianBinaryReader reader)
        {
            TagType = (TagTypes)reader.ReadByte();
            Length = reader.ReadBytes(3);
            TimeStamp = reader.ReadBytes(4);
            StreamId = reader.ReadBytes(3);
            Data = reader.ReadBytes((int)LengthValue);

            //BECAUSE SOMEONE AT ADOBE THOUGHT IT'D BE A GRAND IDEA TO DO MIXED ENDIAN
            //( ͡° ͜ʖ ͡°) comic saaaanssss, comic saaaaaaaaaaaaaaaanssssssss
            TimeStampNormal = new byte[TimeStamp.Length];
            TimeStampNormal[0] = TimeStamp[3];
            TimeStampNormal[1] = TimeStamp[0];
            TimeStampNormal[2] = TimeStamp[1];
            TimeStampNormal[3] = TimeStamp[2];
        }

Usage Example

示例#1
0
        public void Load(Stream stream)
        {
            var reader = new EndianBinaryReader(EndianBitConverter.Big, stream);

            //Header
            reader.ReadBytes(3); // "FLV"
            Version    = reader.ReadByte();
            Bitmask    = (BitmaskTypes)reader.ReadByte();
            HeaderSize = reader.ReadUInt32();

            //Start reading tags
            while (stream.Position < stream.Length)
            {
                var footer = reader.ReadUInt32();
                if (stream.Position >= stream.Length)
                {
                    break;
                }
                var tag = new FlvTag();

                tag.Load(reader);
                Tags.Add(tag);
            }
        }
All Usage Examples Of RTMP.FlvTag::Load