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

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

?? 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一区二区三区免费野_久草精品视频
成人久久18免费网站麻豆| 亚洲一区二区三区中文字幕 | 欧美日韩美女一区二区| 一本色道久久综合亚洲91| 国产精品亚洲人在线观看| 亚洲国产成人av网| 亚洲美女视频在线观看| 国产精品国模大尺度视频| 欧美电视剧在线看免费| 欧美高清你懂得| 欧美日免费三级在线| 色综合色狠狠综合色| 色域天天综合网| 91在线观看视频| 色综合天天综合狠狠| av中文字幕亚洲| 色婷婷综合视频在线观看| 99久久精品国产一区| 91丝袜美女网| 欧美色老头old∨ideo| 欧美少妇xxx| 欧美一级视频精品观看| 精品国产乱码久久久久久闺蜜| 欧美mv和日韩mv国产网站| 日韩女优视频免费观看| 久久综合国产精品| 国产精品嫩草影院av蜜臀| 国产精品美女久久久久久久久久久 | 亚洲午夜视频在线| 日韩精品一级二级| 国产一区二区电影| 日本电影欧美片| 日韩一区二区在线看片| 亚洲国产高清aⅴ视频| 亚洲精品乱码久久久久久黑人| 国产美女主播视频一区| 色婷婷久久一区二区三区麻豆| 欧美亚洲精品一区| 五月综合激情网| 成人激情黄色小说| 欧美日韩美少妇 | 久久久久亚洲蜜桃| 一区二区三区成人| 国产一区二区91| 欧美日韩精品一区视频| 欧美国产禁国产网站cc| 石原莉奈在线亚洲三区| 成人av免费在线观看| 欧美成人猛片aaaaaaa| 一区二区三区在线播| 久久99精品久久久| 欧美日韩国产美| 一区二区在线观看不卡| 粉嫩一区二区三区性色av| 日韩午夜激情电影| 亚洲丰满少妇videoshd| 欧洲另类一二三四区| 尤物在线观看一区| 91同城在线观看| 国产精品日日摸夜夜摸av| 国模娜娜一区二区三区| 91精品福利在线一区二区三区 | 欧美福利电影网| 亚洲午夜视频在线| 国产成人在线网站| 日韩成人午夜电影| 成人自拍视频在线| 国产精品久久久久久亚洲毛片| 色综合久久久久久久久久久| 午夜精彩视频在线观看不卡| 夜夜夜精品看看| 欧美精品一区二区三| 久久97超碰国产精品超碰| 日韩精品一区在线观看| 肉丝袜脚交视频一区二区| 欧美日产在线观看| 裸体一区二区三区| 在线成人av影院| 精品亚洲porn| 久久美女艺术照精彩视频福利播放| 蜜桃视频一区二区| 欧美激情艳妇裸体舞| 成人18视频日本| 亚洲国产乱码最新视频| 91麻豆精品国产91久久久久久 | 欧美一区二区三区男人的天堂| 五月婷婷激情综合| 精品国产一区久久| 一本大道综合伊人精品热热| 日本欧美在线看| 中文字幕在线观看不卡| 精品国产乱码久久久久久久| 色婷婷综合视频在线观看| 国产一区在线观看视频| 亚洲一区二区三区中文字幕在线| 精品成人私密视频| 3d动漫精品啪啪1区2区免费| 99re这里只有精品6| 国模大尺度一区二区三区| 午夜精品福利在线| 亚洲天堂2014| 国产精品无人区| 中文字幕乱码久久午夜不卡| 日韩欧美一二三四区| 欧美日韩国产精品成人| 日本韩国欧美国产| 91啦中文在线观看| 成人午夜伦理影院| 成人一区二区三区| 成人h动漫精品一区二区| 国产精品综合久久| 国产精品一区二区久久精品爱涩| 麻豆成人91精品二区三区| 成人性生交大片免费看在线播放| 国产做a爰片久久毛片| 国产精品系列在线播放| 久久久国产午夜精品| 国产精品嫩草99a| 日韩成人一级片| 色综合久久中文综合久久牛| 91精品欧美综合在线观看最新| 国产午夜亚洲精品午夜鲁丝片| 亚洲综合视频在线观看| 日本vs亚洲vs韩国一区三区| 精品午夜久久福利影院| 色综合久久久网| 欧美一级xxx| 亚洲视频免费在线观看| 亚洲18影院在线观看| 国产剧情在线观看一区二区 | 国产人成一区二区三区影院| 国内精品视频一区二区三区八戒| 日韩影院精彩在线| 亚洲亚洲精品在线观看| 色综合天天综合狠狠| 亚洲一区二区三区小说| 欧美日韩在线三级| 成人在线视频一区二区| 精品少妇一区二区三区免费观看 | 成人黄色国产精品网站大全在线免费观看| 日韩影院免费视频| 三级久久三级久久| 日韩欧美在线综合网| 在线视频国内自拍亚洲视频| 亚洲一区视频在线观看视频| 国产色婷婷亚洲99精品小说| 日本一区二区成人| 亚洲天堂2016| 亚洲电影第三页| 午夜一区二区三区视频| 91小视频免费看| 国产精品久久久久久福利一牛影视| 中文字幕一区二区三区在线观看| 丁香啪啪综合成人亚洲小说| 欧美老女人在线| av电影一区二区| 久久国产生活片100| 亚洲综合一区二区三区| 一本久久a久久免费精品不卡| 国产精品乱码久久久久久| 国产乱码精品一区二区三区五月婷| 欧美优质美女网站| av网站一区二区三区| 欧美日韩不卡在线| 成人免费观看视频| 欧美三级午夜理伦三级中视频| 国产福利91精品| 日韩av在线免费观看不卡| 亚洲色图.com| 久久久久国色av免费看影院| 欧美久久一二三四区| 日日摸夜夜添夜夜添亚洲女人| 国产精品福利一区| 精品国产在天天线2019| 久久精品久久99精品久久| 亚洲高清视频在线| 亚洲色图在线视频| 午夜精品一区二区三区电影天堂| 国产精品久久久久久久裸模| 国产丶欧美丶日本不卡视频| 欧美久久一二区| 国产毛片一区二区| 欧美蜜桃一区二区三区| 亚洲国产日产av| 成人精品免费网站| 精品一区二区三区在线播放| 免费在线看成人av| 精品国产欧美一区二区| 成人av在线资源网站| 一级日本不卡的影视| 精品国精品国产尤物美女| 成人毛片视频在线观看| 久久精品这里都是精品| 色嗨嗨av一区二区三区| 日本免费在线视频不卡一不卡二| av福利精品导航| 欧美精品一区二区三区蜜桃视频| 国产精品99久久久| 成人白浆超碰人人人人| 久久久久成人黄色影片|