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); } }
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); } }
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; }
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); } }