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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? instream.java

?? java版本的flash文件(swf)播放器
?? JAVA
字號:
/****************************************************************
 * 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.io;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Enumeration;
import java.util.Vector;
import java.util.zip.InflaterInputStream;

/**
 * Input Stream Wrapper
 */
public class InStream
{
	protected InputStream in;
	protected long bytesRead = 0L;
    
	private static final int MAX_TRANSFER_BUFFER_SIZE = 10000;

	//--Bit buffer..
	protected int bitBuf;
	protected int bitPos;
    
	public InStream( InputStream in )
	{
		this.in = in;
        
		synchBits();        
	}
            
	public InStream( byte[] bytes )
	{
		this( new ByteArrayInputStream( bytes ) );
	}
    
	/**
	 * Start reading compressed data - all further input is
	 * assumed to come from a zip compressed stream.
	 */
	public void readCompressed() 
	{
		in = new InflaterInputStream( in );
	}
    
	/**
	 * Transfer a number of bytes to an output stream
	 * 
	 * @param length the number of bytes to transfer
	 */
	public void transfer( OutputStream out, int length )
		throws IOException 
	{
		int buffSize = (length < MAX_TRANSFER_BUFFER_SIZE) ?
							length : MAX_TRANSFER_BUFFER_SIZE;
    						
		byte[] buffer = new byte[ buffSize ];
    	
		int read;
    	
		while( (read = in.read( buffer )) > 0 ) {
			out.write( buffer, 0, read );
		}
	}
    
	/**
	 * Read a string from the input stream
	 */
	public byte[] readStringBytes() throws IOException 
	{
		synchBits();
        
		Vector chars = new Vector();
		byte[] aChar = new byte[1];
		int num = 0;
        
		while( ( num = in.read( aChar )) == 1 )
		{
			bytesRead++;
            
			if( aChar[0] == 0 ) //end of string
			{
				byte[] string = new byte[chars.size()];
                
				int i = 0;
				for( Enumeration enum = chars.elements(); enum.hasMoreElements(); )
				{
					string[i++] = ((Byte)enum.nextElement()).byteValue();
				}
                
				return string;
			}
            
			chars.addElement( new Byte(aChar[0]) );
		}
        
		throw new IOException( "Unterminated string - reached end of input before null char" );
	}

	/**
	 * Read a null terminated string using the default character encoding
	 */
	public String readString( String encoding ) throws IOException 
	{
		return new String( readStringBytes(), encoding );
	}

	/**
	 * Read all remaining bytes from the stream
	 */
	public byte[] read() throws IOException
	{
		ByteArrayOutputStream bout = new ByteArrayOutputStream();
        
		int b = 0;
		while( ( b = in.read()) >= 0 )
		{
			bout.write( b );
		}
        
		return bout.toByteArray();
	}
    
	/**
	 * Read bytes from the input stream - throw up if all bytes are not available
	 */
	public byte[] read( int length ) throws IOException
	{
		byte[] data = new byte[ length ];
        
		if( length > 0 )
		{
			int read = 0;
            
			while( read < length )
			{
				int count = in.read( data, read, length-read );
				if( count < 0 )
				{
					bytesRead += read;
					throw new IOException( "Unexpected end of input while reading a specified number of bytes" );
				}
                
				read += count;
			}
            
			bytesRead += read;
		}
        
		return data;
	}
    
	/**
	 * Read as many bytes as possible (up to the limit of the passed-in array)
	 * @return the number of bytes read
	 */
	public int read( byte[] bytes ) throws IOException
	{
		int length = bytes.length;
        
		if( length > 0 )
		{
			int read = 0;
            
			while( read < length )
			{
				int count = in.read( bytes, read, length-read );
				if( count < 0 )
				{
					bytesRead += read;
					return read;
				}
                
				read += count;
			}
            
			bytesRead += read;
			return read;
		}
        
		return 0;
	}    
    
	/**
	 * Reset the bit buffer
	 */
	public void synchBits()
	{
		bitBuf = 0;
		bitPos = 0;
	}
    
	public long getBytesRead() { return bytesRead; }
	public void setBytesRead( long read ) { bytesRead = read; }
    
	/**
	 * Skip a number of bytes from the input stream
	 */
	public void skipBytes( long length ) throws IOException 
	{
		long skipped = 0;
        
		while( skipped < length )
		{
			int val = in.read();
            
			if( val < 0 ) throw new IOException( "Unexpected end of input" );
            
			skipped++;
		}
        
		bytesRead += length;
	}
    
	/**
	 * Read an unsigned value from the given number of bits
	 */
	public long readUBits( int numBits ) throws IOException
	{
		if( numBits == 0 ) return 0;
        
		int  bitsLeft = numBits;
		long result   = 0;

		if( bitPos == 0 ) //no value in the buffer - read a byte
		{
			bitBuf = in.read();
			bitPos = 8;
            
			bytesRead++;
		}
        
		while( true )
		{
			int shift = bitsLeft - bitPos;
			if( shift > 0 )
			{
				// Consume the entire buffer
				result |= bitBuf << shift;
				bitsLeft -= bitPos;

				// Get the next byte from the input stream
				bitBuf = in.read();
				bitPos = 8;
            
				bytesRead++;
			}
			else
			{
				// Consume a portion of the buffer
				result |= bitBuf >> -shift;
				bitPos -= bitsLeft;
				bitBuf &= 0xff >> (8 - bitPos);	// mask off the consumed bits

				return result;
			}
		}        
	}

	/**
	 * Read an unsigned 8 bit value
	 */
	public int readUI8() throws IOException
	{
		synchBits();
        
		int ui8 = in.read();
		if( ui8 < 0 ) throw new IOException( "Unexpected end of input" );

		bytesRead++;
        
		return ui8;        
	}
    
	/**
	 * Read an unsigned 16 bit value
	 */
	public int readUI16() throws IOException
	{
		synchBits();
        
		int ui16 = in.read();
		if( ui16 < 0 ) throw new IOException( "Unexpected end of input" );
        
		int val = in.read();
		if( val < 0 ) throw new IOException( "Unexpected end of input" );

		ui16 += val << 8;

		bytesRead += 2;
        
		return ui16;
	}  
    
	/**
	 * Read a signed 16 bit value
	 */
	public short readSI16() throws IOException
	{
		synchBits();

		int lowerByte = in.read();       
		if( lowerByte < 0 ) throw new IOException( "Unexpected end of input" );
        
		byte[] aByte = new byte[1];  
		int count = in.read( aByte );
		if( count < 1 ) throw new IOException( "Unexpected end of input" );

		bytesRead += 2;
        
		return (short)((aByte[0]*256) + lowerByte);
	}  
    
	/**
	 * Read an unsigned 32 bit value
	 */
	public long readUI32() throws IOException
	{
		synchBits();
        
		long ui32 = in.read();
		if( ui32 < 0 ) throw new IOException( "Unexpected end of input" );
        
		long val = in.read();
		if( val < 0 ) throw new IOException( "Unexpected end of input" );

		ui32 += val << 8;
        
		val = in.read();
		if( val < 0 ) throw new IOException( "Unexpected end of input" );

		ui32 += val << 16;
               
		val = in.read();
		if( val < 0 ) throw new IOException( "Unexpected end of input" );
        
		ui32 += val << 24;

		bytesRead += 4;       
        
		return ui32;
	}  
    
	/**
	 * Read a signed value from the given number of bits
	 */
	public int readSBits( int numBits ) throws IOException
	{
		// Get the number as an unsigned value.
		long uBits = readUBits( numBits );

		// Is the number negative?
		if( ( uBits & (1L << (numBits - 1))) != 0 )
		{
			// Yes. Extend the sign.
			uBits |= -1L << numBits;
		}

		return (int)uBits;        
	}        
    
	/**
	 * Read a 32 bit signed number
	 */
	public int readSI32() throws IOException 
	{
		synchBits();

		int b0 = in.read();       
		if( b0 < 0 ) throw new IOException( "Unexpected end of input" );

		int b1 = in.read();       
		if( b1 < 0 ) throw new IOException( "Unexpected end of input" );

		int b2 = in.read();       
		if( b2 < 0 ) throw new IOException( "Unexpected end of input" );
        
		byte[] aByte = new byte[1];  
		int count = in.read( aByte );
		if( count < 1 ) throw new IOException( "Unexpected end of input" );

		bytesRead += 4;
        
		return (int)((aByte[0]*256*256*256) 
					   + (b2*256*256)
					   + (b1*256)
					   + b0 );
	}
    
	/**
	 * Read a 32 bit floating point number
	 */
	public float readFloat() throws IOException 
	{
		return Float.intBitsToFloat( readSI32() );
	}
    
	/**
	 * Read a 64 bit floating point number
	 */
	public double readDouble() throws IOException
	{
		byte[] bytes = read( 8 );
        
		byte[] bytes2 = new byte[8];
        
		bytes2[0] = bytes[3];
		bytes2[1] = bytes[2];
		bytes2[2] = bytes[1];
		bytes2[3] = bytes[0];
		bytes2[4] = bytes[7];
		bytes2[5] = bytes[6];
		bytes2[6] = bytes[5];
		bytes2[7] = bytes[4];
        
		ByteArrayInputStream bin = new ByteArrayInputStream( bytes2 );

		return new DataInputStream( bin ).readDouble();
	}
    
	/**
	 * Util to convert an unsigned byte to an unsigned int
	 */
	public static int ubyteToInt( byte b )
	{
		boolean highbit = b < 0;
        
		b &= 0x7f;
        
		int i = (int)b;
        
		if( highbit ) i += 128;
        
		return i;
	}
    
	/**
	 * Util to convert 2 bytes to a signed value
	 */
	public static int bytesToSigned( byte lo, byte hi )
	{
		int low  = ubyteToInt( lo );
		int high = ubyteToInt( hi );
        
		int value = (high << 8) + low;
        
		if( value > 0x7fff )
		{ 
			value -= 65536;
		}
        
		return value;
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本欧美久久久久免费播放网| 人人狠狠综合久久亚洲| 1000部国产精品成人观看| 亚洲综合图片区| 久久 天天综合| 在线亚洲精品福利网址导航| 日韩一区二区三区三四区视频在线观看| 久久毛片高清国产| 一区二区成人在线视频| 亚洲永久精品大片| 国模一区二区三区白浆| 一本色道久久综合狠狠躁的推荐| 欧美一区二区三区性视频| 国产精品美女www爽爽爽| 亚洲欧美一区二区视频| 日本网站在线观看一区二区三区| 成人美女视频在线看| 91黄视频在线| 亚洲免费视频成人| 精品在线免费观看| 日韩天堂在线观看| 亚洲一区二区在线视频| 国产精品资源在线看| 亚洲精品一线二线三线| 亚洲chinese男男1069| 99精品久久免费看蜜臀剧情介绍| 欧美国产精品久久| 麻豆国产欧美一区二区三区| 在线欧美一区二区| 亚洲日本在线观看| 成人精品国产免费网站| 欧美激情艳妇裸体舞| 亚洲国产你懂的| 欧美精品一二三| 国产精一区二区三区| 国产成人av网站| 中文在线一区二区| 国产91丝袜在线播放| 精品免费日韩av| 国产乱人伦偷精品视频不卡| 日韩欧美二区三区| 亚洲一区二区三区中文字幕在线| 欧美亚洲国产一区在线观看网站 | 91麻豆国产自产在线观看| 久久亚洲二区三区| 成人网男人的天堂| 国产欧美日本一区视频| 水野朝阳av一区二区三区| 91精品在线免费| 亚洲国产精品久久艾草纯爱| 欧美一区二区在线免费播放| 久久综合一区二区| av在线播放成人| www.欧美精品一二区| a级精品国产片在线观看| 国产成人免费视频一区| 国产福利一区二区三区在线视频| 久久精品国产77777蜜臀| 国产日韩欧美一区二区三区综合| jvid福利写真一区二区三区| 91免费国产在线观看| 依依成人精品视频| 欧美日韩精品一区二区三区| 亚洲福利电影网| 久久精品亚洲麻豆av一区二区| 成人精品视频.| 亚洲aaa精品| 日韩一级黄色大片| 久久疯狂做爰流白浆xx| 一区二区在线看| 91精品国产一区二区三区香蕉 | 久久精品国产**网站演员| 久久精品亚洲精品国产欧美kt∨ | 中文字幕欧美国产| 99这里只有精品| 亚洲最新在线观看| 久久九九久精品国产免费直播| 成人一区二区三区视频在线观看| 亚洲国产综合视频在线观看| 久久综合狠狠综合久久综合88| 国产精品1024久久| 奇米精品一区二区三区四区| 国产精品毛片高清在线完整版| 免费成人av资源网| 9191久久久久久久久久久| 亚洲国产综合色| 亚洲精品一区二区三区在线观看 | 精品视频免费在线| 激情综合色综合久久综合| 一区二区三区欧美在线观看| 日韩天堂在线观看| 99久久国产综合精品色伊| 国产高清久久久| 亚洲va国产天堂va久久en| 欧美一二三区在线| 欧美三级三级三级爽爽爽| 国产精品123区| 亚洲成a人片在线观看中文| 国产午夜精品一区二区三区嫩草 | 日韩无一区二区| 国产精品综合久久| 免费久久99精品国产| 亚洲女同ⅹxx女同tv| 18涩涩午夜精品.www| 精品国产免费一区二区三区香蕉| 在线免费视频一区二区| 91视频观看视频| 国产二区国产一区在线观看| 亚洲精品日韩一| 亚洲影院久久精品| 中文字幕日韩av资源站| 成人免费一区二区三区视频| 精品对白一区国产伦| 在线播放国产精品二区一二区四区 | 久久九九全国免费| 欧美成人一区二区三区在线观看 | 日韩女优av电影在线观看| 欧美日韩一区精品| 91免费国产视频网站| 色婷婷国产精品| 972aa.com艺术欧美| 青青草97国产精品免费观看无弹窗版| 同产精品九九九| 亚洲成人手机在线| 麻豆精品久久精品色综合| 日本成人超碰在线观看| 一区二区激情小说| 日本欧美韩国一区三区| 亚洲va中文字幕| 久久精品二区亚洲w码| 久久超碰97中文字幕| 另类中文字幕网| 春色校园综合激情亚洲| 国产成人av电影在线| 老汉av免费一区二区三区| 国产精品影视在线| 国产很黄免费观看久久| 91蝌蚪porny| 色拍拍在线精品视频8848| 日本久久电影网| 国产综合成人久久大片91| 亚洲精品中文在线| 国产一区二区三区综合| 国产精品夫妻自拍| 一区免费观看视频| 亚洲成人综合网站| 首页欧美精品中文字幕| 美女一区二区三区在线观看| 成人av高清在线| 日本韩国欧美三级| 在线观看免费视频综合| 日韩免费性生活视频播放| 久久久99精品免费观看不卡| 亚洲人成精品久久久久| 日韩综合在线视频| 国产精品自拍在线| 欧美美女视频在线观看| 精品乱人伦一区二区三区| 中文字幕日韩av资源站| 日一区二区三区| 国产麻豆9l精品三级站| 777精品伊人久久久久大香线蕉| 欧美成人a∨高清免费观看| 国产三级精品视频| 日产国产高清一区二区三区| 福利视频网站一区二区三区| 99久久精品免费| 欧美一区二区精品在线| 国产精品天干天干在观线| 日韩福利电影在线| 成人性视频免费网站| 丁香亚洲综合激情啪啪综合| 欧美一级爆毛片| 最新高清无码专区| 国产乱子伦一区二区三区国色天香| av在线不卡观看免费观看| 欧美一区二区三区四区久久| 一区二区三区四区在线免费观看| 乱一区二区av| 久久精品国产一区二区三| 欧美肥大bbwbbw高潮| 国产精品不卡一区| 国产宾馆实践打屁股91| 欧美日韩在线播放| 久久综合久久综合九色| 日韩中文字幕91| 色系网站成人免费| 亚洲欧洲精品一区二区三区不卡| 九九精品一区二区| 欧美久久久久久久久| 亚洲综合激情网| www..com久久爱| 欧美日韩亚洲综合一区二区三区| 国产精品毛片大码女人| 三级久久三级久久| 色婷婷狠狠综合| 一区二区三区中文在线观看| 国产成人亚洲精品狼色在线| wwwwww.欧美系列| 天堂久久一区二区三区|