private static void ReadActions(ISwfStreamReader reader, int length, IList <ActionBase> actions) { var bytes = reader.ReadBytes(length); var mem = new MemoryStream(bytes); var ar = new ActionReader(new SwfStreamReader(mem)); while (mem.Position != mem.Length) { actions.Add(ar.ReadAction()); } }
public static SwfTagData ReadTagData(this ISwfStreamReader reader) { var typeAndSize = reader.ReadUInt16(); var type = (SwfTagType)(typeAndSize >> 6); var shortSize = typeAndSize & 0x3f; var size = shortSize < 0x3f ? shortSize : reader.ReadInt32(); var tagData = reader.ReadBytes(size); return(new SwfTagData { Type = type, Data = tagData }); }
ActionBase IActionVisitor <ushort, ActionBase> .Visit(ActionUnknown action, ushort length) { action.Data = _reader.ReadBytes(length); return(action); }