Пример #1
0
        public HeaderRecord(FlashReader input)
        {
            ushort header = header = input.ReadUInt16();

            Kind = (TagKind)(header >> 6);

            Length = (header & 63);
            if (Length > MAX_SHORT_LENGTH)
            {
                Length     = input.ReadInt32();
                _isLongTag = (Length <= MAX_SHORT_LENGTH);
            }
        }
Пример #2
0
        public DefineBitsJPEG3(HeaderRecord header, FlashReader input)
            : base(header)
        {
            Id = input.ReadUInt16();

            int alphaDataOffset = input.ReadInt32();

            Data = input.ReadBytes(alphaDataOffset);

            Format = GetFormat(Data);
            if (Format == ImageFormat.JPEG)
            {
                int partialLength = (2 + 4 + alphaDataOffset);
                AlphaData = input.ReadBytes(Header.Length - partialLength);
            }
        }
Пример #3
0
        public TagRecord(FlashReader reader)
        {
            Start = reader.Position;

            ushort header = reader.ReadUInt16();

            TagType = (FlashTagType)(header >> 6);

            int length = (header & 63);

            if (length >= 63)
            {
                length        = reader.ReadInt32();
                IsSpecialLong = (length < 63);
            }
            BodyStart = reader.Position;

            Body            = reader.ReadBytes(length);
            reader.Position = BodyStart;
        }
Пример #4
0
        public DefineBitsJPEG3(HeaderRecord header, FlashReader input) : base(header)
        {
            Id = input.ReadUInt16();

            var alphaDataOffset = input.ReadInt32();

            Data   = input.ReadBytes(alphaDataOffset);
            Format = GetFormat(Data);

            if (Format == ImageFormat.JPEG)
            {
                var partialLength = 2 + 4 + alphaDataOffset;
                AlphaData = input.ReadBytes(Header.Length - partialLength);
            }
            else
            {
                // Minimum Compressed Empty Data Length
                AlphaData = input.ReadBytes(8);
            }
        }