亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? actionwriter.java

?? java版本的flash文件(swf)播放器
?? JAVA
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
/****************************************************************
 * Copyright (c) 2001, David N. Main, All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or
 * without modification, are permitted provided that the 
 * following conditions are met:
 *
 * 1. Redistributions of source code must retain the above 
 * copyright notice, this list of conditions and the following 
 * disclaimer. 
 * 
 * 2. Redistributions in binary form must reproduce the above 
 * copyright notice, this list of conditions and the following 
 * disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * 3. The name of the author may not be used to endorse or 
 * promote products derived from this software without specific 
 * prior written permission. 
 * 
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 
 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
 * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 ****************************************************************/
package com.anotherbigidea.flash.writers;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Stack;
import java.util.Vector;

import com.anotherbigidea.flash.SWFActionCodes;
import com.anotherbigidea.flash.SWFConstants;
import com.anotherbigidea.flash.interfaces.SWFActions;
import com.anotherbigidea.io.OutStream;

/**
 * A writer that implements the SWFActions interface and writes
 * action bytes to an OutStream
 */
public class ActionWriter implements SWFActions, SWFActionCodes 
{
    protected TagWriter tagWriter;
    protected OutStream out;
    protected ByteArrayOutputStream bout;
    protected int count;
    protected int flashVersion;
    protected String mStringEncoding;
    
    protected Vector pushValues;
    
    protected Hashtable labels;
    protected Vector jumps;
    protected Vector skips;
    
    //--for fixing up functions and WITH blocks..
    protected Vector blocks;
    protected Stack  blockStack;
    
    public ActionWriter( TagWriter tagWriter, int flashVersion )
    {
        this.flashVersion = flashVersion;
        this.tagWriter = tagWriter;
        
        mStringEncoding = ( flashVersion >= SWFConstants.FLASH_MX_VERSION ) ?
        						SWFConstants.STRING_ENCODING_MX :
								SWFConstants.STRING_ENCODING_PRE_MX;
    }
                            
    /**
     * @return the code count
     */
    protected int writeCode( int code ) throws IOException 
    {
        if( pushValues.size() > 0 ) flushPushValues();
        out.writeUI8( code );
        count++;
        return count;
    }
    
    /**
     * SWFActions interface
     */
    public void start( int conditions ) throws IOException
    {
        //ignore conditions
        
        count      = 0;
        bout       = new ByteArrayOutputStream();
        out        = new OutStream( bout );
        pushValues = new Vector();
        labels     = null;
        jumps      = null;
        skips      = null;
        blocks     = null;
        blockStack = null;        
    }    
    
    /**
     * SWFActions interface
     */
    public void end() throws IOException
    {
        writeCode( 0 );
        out.flush();
        byte[] bytes = bout.toByteArray();
     
        //--Fix up jumps and skips
        if( labels != null )
        {
            if( jumps != null ) fixupJumps(bytes);
            if( skips != null ) fixupSkips(bytes);
        }
        
        if( blocks != null ) fixupBlocks(bytes);

        writeBytes( bytes );
    }
    
    /**
     * Pass through a blob of actions
     */
    public void blob( byte[] blob ) throws IOException
    {
        writeBytes( blob );
    }
        
    protected void writeBytes( byte[] bytes ) throws IOException
    {
        tagWriter.getOutStream().write( bytes );                       
    }
    
    /**
     * SWFActions interface
     */
    public void done() throws IOException
    {
        tagWriter.completeTag();
    }
        
    protected void fixupBlocks( byte[] bytes )
    {
        for( Enumeration enum = blocks.elements(); enum.hasMoreElements(); )
        {
            int[] info = (int[])enum.nextElement();
            
            int codeSize = info[1];
            int offset   = info[0];
            byte[] sizeBytes = OutStream.sintTo2Bytes( codeSize );
            
            bytes[ offset     ] = sizeBytes[0];
            bytes[ offset + 1 ] = sizeBytes[1];
        }
    }
    
    protected void fixupJumps( byte[] bytes )
    {
        for( Enumeration enum = jumps.elements(); enum.hasMoreElements(); )
        {
            Object[] obja = (Object[])enum.nextElement();
            String label  = (String)obja[0];
            int    target = ((Integer)obja[1]).intValue();
            
            int[] labelInfo = (int[])labels.get( label );
            
            if( labelInfo == null )
            {
                System.out.println( "Missing label '" + label + "' in action code" );
                continue;
            }
            
            int absolute = labelInfo[0];  //offset of the label            
            int relative = absolute - ( target + 2 );  //relative jump
            
            byte[] val = OutStream.sintTo2Bytes( relative );
            bytes[target  ] = val[0];
            bytes[target+1] = val[1];
        }
    }
    
    protected void fixupSkips( byte[] bytes )
    {
        for( Enumeration enum = skips.elements(); enum.hasMoreElements(); )
        {
            Object[] obja = (Object[])enum.nextElement();
            String label  = (String)obja[0];
            
            int[] skipInfo  = (int[])obja[1];
            int   skipIndex = skipInfo[0];
            int   skipLoc   = skipInfo[1];            
            
            int[] labelInfo = (int[])labels.get( label );
            
            if( labelInfo == null )
            {
                System.out.println( "Missing label '" + label + "' in action code" );
                continue;
            }
            
            int labelIndex = labelInfo[1];  //index of the labelled action
            int skip = labelIndex - skipIndex - 1;

            byte val = OutStream.uintToByte( skip );
            bytes[skipLoc] = val;
        }
    }

    /**
     * SWFActions interface
     */
    public void comment( String comment ) throws IOException
    {
        //ignore comments
    }    
    
    /**
     * SWFActions interface
     */
    public void unknown( int code, byte[] data ) throws IOException
    {
        writeCode( code );
        
        int length = (data != null) ? data.length : 0;
        
        if( code >= 0x80 || length > 0 )
        {
            out.writeUI16( length );
        }
        
        if( length > 0 ) out.write( data );
    }
    
    /**
     * SWFActions interface
     */
    public void initArray() throws IOException 
    {
        writeCode( INIT_ARRAY );
    }    
        
    /**
     * SWFActions interface
     */
    public void jumpLabel( String label ) throws IOException
    {
        if( pushValues.size() > 0 ) flushPushValues();
        
        int offset = (int)out.getCount();
        
        if( labels == null ) labels = new Hashtable();        
        labels.put( label, new int[] { offset, count + 1 } );
    }    
  
    /**
     * SWFActions interface
     */
    public void gotoFrame( int frameNumber ) throws IOException
    {
        writeCode( GOTO_FRAME );
        out.writeUI16( 2 );
        out.writeUI16( frameNumber );
    }
    
    /**
     * SWFActions interface
     */
    public void gotoFrame( String label ) throws IOException
    {
        writeCode( GOTO_LABEL );
        out.writeUI16  ( OutStream.getStringLength( label ) );
        out.writeString( label, mStringEncoding );
    }
    
    /**
     * SWFActions interface
     */
    public void getURL( String url, String target ) throws IOException
    {
        writeCode( GET_URL );
        out.writeUI16  ( OutStream.getStringLength(url) + OutStream.getStringLength(target) );
        out.writeString( url, mStringEncoding );
        out.writeString( target, mStringEncoding );
    }
    
    /**
     * SWFActions interface
     */
    public void nextFrame() throws IOException
    {
        writeCode( NEXT_FRAME );
    }
    
    /**
     * SWFActions interface
     */
    public void prevFrame() throws IOException
    {
        writeCode( PREVIOUS_FRAME );
    }
    
    /**
     * SWFActions interface
     */
    public void play() throws IOException
    {
        writeCode( PLAY );
    }
    
    /**
     * SWFActions interface
     */
    public void stop() throws IOException
    {
        writeCode( STOP );
    }
    
    /**
     * SWFActions interface
     */
    public void toggleQuality() throws IOException
    {
        writeCode( TOGGLE_QUALITY );
    }
    
    /**
     * SWFActions interface
     */
    public void stopSounds() throws IOException
    {
        writeCode( STOP_SOUNDS );
    }
    
    /**
     * SWFActions interface
     */
    public void setTarget( String target ) throws IOException
    {
        writeCode( SET_TARGET );
        out.writeUI16  ( OutStream.getStringLength( target ) );
        out.writeString( target, mStringEncoding );
    }

    protected void writeJump( String label, int code ) throws IOException 
    {
        writeCode( code );
        out.writeUI16( 2 );
        
        int here = (int)out.getCount();
        out.writeUI16( 0 );   //will be fixed up later
        
        //--save jump info for later fix-up logic
        if( jumps == null ) jumps = new Vector();
        jumps.addElement( new Object[] { label, new Integer( here ) } );
    }
    
    /**
     * SWFActions interface
     */
    public void jump( String jumpLabel ) throws IOException
    {
        writeJump( jumpLabel, JUMP );
    }
    
    /**
     * SWFActions interface
     */
    public void ifJump( String jumpLabel ) throws IOException
    {
        writeJump( jumpLabel, IF );
    }
    
    /**
     * SWFActions interface
     */
    public void waitForFrame( int frameNumber, String jumpLabel ) throws IOException
    {
        writeCode( WAIT_FOR_FRAME );
        out.writeUI16( 3 );
        out.writeUI16( frameNumber );

        int here = (int)out.getCount();
        out.writeUI8 ( 0 ); //will be fixed up later
        
        //--save skip info for later fix-up logic
        if( skips == null ) skips = new Vector();
        skips.addElement( new Object[] { jumpLabel, new int[] { count, here }} );        
    }
    
    /**
     * SWFActions interface
     */
    public void waitForFrame( String jumpLabel ) throws IOException
    {
        writeCode( WAIT_FOR_FRAME_2 );
        out.writeUI16( 1 );

        int here = (int)out.getCount();
        out.writeUI8 ( 0 ); //will be fixed up later
        
        //--save skip info for later fix-up logic
        if( skips == null ) skips = new Vector();
        skips.addElement( new Object[] { jumpLabel, new int[] { count, here }} );        
    }
    
    /**
     * SWFActions interface
     */

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99re这里只有精品首页| 日韩午夜在线播放| 亚洲一二三四区不卡| 欧美亚日韩国产aⅴ精品中极品| 亚洲午夜视频在线观看| 欧美日韩大陆一区二区| 久久av资源站| 国产精品国产三级国产普通话99 | 亚洲一区二区在线观看视频| 欧美日韩在线播放一区| 另类的小说在线视频另类成人小视频在线 | 福利91精品一区二区三区| 国产精品传媒在线| 欧美日韩美少妇| 狠狠色伊人亚洲综合成人| 欧美国产综合一区二区| 在线观看一区二区视频| 麻豆精品一二三| 国产精品电影一区二区| 欧美日韩国产色站一区二区三区| 老司机午夜精品99久久| 中文字幕av一区二区三区免费看| 欧美专区亚洲专区| 久久99精品国产麻豆婷婷| 国产精品―色哟哟| 欧美日韩在线播| 国产精品亚洲综合一区在线观看| 亚洲精品高清视频在线观看| 日韩一二三四区| 波多野结衣一区二区三区| 亚洲高清免费视频| 日本一区二区三区四区在线视频| 在线日韩国产精品| 国产美女视频一区| 亚洲国产综合色| 欧美精品一区二区三区蜜臀| 色综合天天做天天爱| 老司机午夜精品| 亚洲免费av观看| 久久色在线视频| 欧美亚洲综合另类| 国产麻豆日韩欧美久久| 亚洲午夜久久久久久久久久久 | 亚洲激情男女视频| 欧美精品一区二区三区蜜桃视频| 色哟哟一区二区在线观看 | 91一区二区三区在线播放| 免费看黄色91| 亚洲欧美日韩国产综合在线 | 日韩女优视频免费观看| 99vv1com这只有精品| 极品美女销魂一区二区三区免费| 亚洲精品日韩一| 国产日韩精品视频一区| 欧美精品99久久久**| 99精品视频一区二区| 国产一区二区福利视频| 亚洲成人av一区二区| 《视频一区视频二区| 久久免费午夜影院| 91麻豆精品国产91久久久久| 95精品视频在线| 国产成人久久精品77777最新版本| 五月开心婷婷久久| 亚洲视频一二三区| 国产色产综合色产在线视频| 日韩一区二区免费在线观看| 91福利视频久久久久| 成人午夜激情片| 激情综合色综合久久| 香蕉av福利精品导航| 亚洲女同一区二区| 欧美激情综合五月色丁香 | 欧美一卡在线观看| 欧美性色aⅴ视频一区日韩精品| 粉嫩av亚洲一区二区图片| 久久激情五月激情| 奇米影视7777精品一区二区| 一区二区成人在线视频| 亚洲视频在线观看一区| 国产精品视频你懂的| 久久综合成人精品亚洲另类欧美| 欧美日韩成人综合在线一区二区 | 色综合视频在线观看| 国产成人av一区| 国产一区二区视频在线| 免费成人结看片| 日韩黄色免费网站| 亚洲不卡av一区二区三区| 亚洲午夜久久久久| 亚洲国产精品人人做人人爽| 亚洲精品免费电影| 综合色中文字幕| 亚洲视频小说图片| 亚洲欧美日本韩国| 亚洲免费在线观看视频| 日韩毛片一二三区| 综合久久国产九一剧情麻豆| 亚洲天堂精品在线观看| 亚洲人精品午夜| 亚洲另类一区二区| 亚洲一区二区三区视频在线| 亚洲另类在线一区| 亚洲一二三区在线观看| 亚洲h在线观看| 五月天国产精品| 免费成人av在线| 美女视频黄 久久| 另类中文字幕网| 国产综合色视频| 高清久久久久久| 成人高清在线视频| 99久久久久免费精品国产| 91小视频免费观看| 欧美色国产精品| 欧美日韩你懂得| 欧美一区日本一区韩国一区| 日韩欧美国产综合| 久久久噜噜噜久噜久久综合| 国产午夜精品久久久久久免费视| 国产女主播一区| 中文字幕一区二| 亚洲一区自拍偷拍| 日韩在线一区二区三区| 精品制服美女丁香| 粉嫩嫩av羞羞动漫久久久| 99久久免费视频.com| 欧美日韩久久一区二区| 欧美videossexotv100| 国产视频一区二区三区在线观看| 亚洲欧洲成人av每日更新| 亚洲男人的天堂在线观看| 亚洲成人激情综合网| 精品一区二区日韩| 成人丝袜18视频在线观看| 一本大道久久a久久精品综合| 欧美人狂配大交3d怪物一区| 日韩欧美在线123| 欧美国产国产综合| 亚洲激情校园春色| 日本系列欧美系列| 国产成人av电影| 色丁香久综合在线久综合在线观看| 欧美日韩欧美一区二区| 久久免费午夜影院| 樱桃国产成人精品视频| 日本伊人色综合网| 成人免费电影视频| 欧美日韩一本到| 久久欧美中文字幕| 洋洋成人永久网站入口| 蜜臀av一区二区| caoporn国产一区二区| 欧美剧情片在线观看| 久久久久久久久久久久电影| 亚洲欧美日韩一区二区 | 欧美tk—视频vk| 1000部国产精品成人观看| 热久久一区二区| av在线不卡免费看| 日韩一区二区免费视频| 亚洲欧美在线另类| 美日韩黄色大片| 99精品欧美一区| 日韩欧美在线网站| 亚洲精品乱码久久久久久黑人| 另类小说色综合网站| 一本久久综合亚洲鲁鲁五月天 | 亚洲女人****多毛耸耸8| 美国精品在线观看| 91视频91自| 精品国产亚洲在线| 亚洲激情六月丁香| 国产成人在线观看| 欧美精品电影在线播放| 中文字幕一区二区三区视频| 久久99国产精品久久99 | 欧美一级免费大片| 亚洲视频免费看| 国产一区二区三区四区五区入口| 欧美亚一区二区| 国产精品久久久久久久久免费相片| 蜜臀精品一区二区三区在线观看| 色婷婷亚洲精品| 久久久不卡网国产精品二区 | 不卡免费追剧大全电视剧网站| 91精品国产免费久久综合| 亚洲人成在线观看一区二区| 国产一区二区不卡| 日韩午夜激情视频| 亚洲一区二区三区四区在线观看| 成人国产一区二区三区精品| 精品日产卡一卡二卡麻豆| 午夜视黄欧洲亚洲| 91亚洲精华国产精华精华液| 国产日韩欧美高清| 精品亚洲免费视频| 欧美精品久久99| 一区二区三区电影在线播| 成人免费视频视频|