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

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

?? israndomaccessio.java

?? jpeg2000編解碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* * CVS identifier: * * $Id: ISRandomAccessIO.java,v 1.1.1.1 2002/07/22 09:26:53 grosbois Exp $ * * Class:                   ISRandomAccessIO * * Description:             Turns an InsputStream into a read-only *                          RandomAccessIO, using buffering. * * * * COPYRIGHT: *  * This software module was originally developed by Rapha雔 Grosbois and * Diego Santa Cruz (Swiss Federal Institute of Technology-EPFL); Joel * Askel鰂 (Ericsson Radio Systems AB); and Bertrand Berthelot, David * Bouchard, F閘ix Henry, Gerard Mozelle and Patrice Onno (Canon Research * Centre France S.A) in the course of development of the JPEG2000 * standard as specified by ISO/IEC 15444 (JPEG 2000 Standard). This * software module is an implementation of a part of the JPEG 2000 * Standard. Swiss Federal Institute of Technology-EPFL, Ericsson Radio * Systems AB and Canon Research Centre France S.A (collectively JJ2000 * Partners) agree not to assert against ISO/IEC and users of the JPEG * 2000 Standard (Users) any of their rights under the copyright, not * including other intellectual property rights, for this software module * with respect to the usage by ISO/IEC and Users of this software module * or modifications thereof for use in hardware or software products * claiming conformance to the JPEG 2000 Standard. Those intending to use * this software module in hardware or software products are advised that * their use may infringe existing patents. The original developers of * this software module, JJ2000 Partners and ISO/IEC assume no liability * for use of this software module or modifications thereof. No license * or right to this software module is granted for non JPEG 2000 Standard * conforming products. JJ2000 Partners have full right to use this * software module for his/her own purpose, assign or donate this * software module to any third party and to inhibit third parties from * using this software module for non JPEG 2000 Standard conforming * products. This copyright notice must be included in all copies or * derivative works of this software module. *  * Copyright (c) 1999/2000 JJ2000 Partners. * */package jj2000.j2k.util;import jj2000.j2k.io.*;import java.io.*;/** * This class implements a wrapper to turn an InputStream into a * RandomAccessIO. To provide random access, the input data from the * InputStream is cached in an in-memory buffer. The in-memory buffer size can * be limited to a specified size. The data is read into the cache on a as * needed basis, blocking only when necessary. * * <p>The cache grows automatically as necessary. However, if the data length * is known prior to the creation of a ISRandomAccessIO object, it is best to * specify that as the initial in-memory buffer size. That will minimize data * copying and multiple allocation.<p> * * <p>Multi-byte data is read in big-endian order. The in-memory buffer * storage is released when 'close()' is called. This class can only be used * for data input, not output. The wrapped InputStream is closed when all the * input data is cached or when 'close()' is called.</p> * * <p>If an out of memory condition is encountered when growing the in-memory * buffer an IOException is thrown instead of an OutOfMemoryError. The * exception message is "Out of memory to cache input data".</p> * * <p>This class is intended for use as a "quick and dirty" way to give * network connectivity to RandomAccessIO based classes. It is not intended as * an efficient means of implementing network connectivity. Doing such * requires reimplementing the RandomAccessIO based classes to directly use * network connections.</p> * * <p>This class does not use temporary files as buffers, because that would * preclude the use in unsigned applets.</p> * */public class ISRandomAccessIO implements RandomAccessIO {    /** The InputStream that is wrapped */    private InputStream is;    /* Tha maximum size, in bytes, of the in memory buffer. The maximum size     * includes the EOF. */    private int maxsize;    /* The increment, in bytes, for the in-memory buffer size */    private int inc;    /* The in-memory buffer to cache received data */    private byte buf[];    /* The length of the already received data */    private int len;    /* The position of the next byte to be read from the in-memory buffer */    private int pos;    /* Flag to indicate if all the data has been received. That is, if the EOF      * has been reached. */    private boolean complete;    /**     * Creates a new RandomAccessIO wrapper for the given InputStream     * 'is'. The internal cache buffer will have size 'size' and will     * increment by 'inc' each time it is needed. The maximum buffer size is     * limited to 'maxsize'.     *     * @param is The input from where to get the data.     *     * @param size The initial size for the cache buffer, in bytes.     *     * @param inc The size increment for the cache buffer, in bytes.     *     * @param maxsize The maximum size for the cache buffer, in bytes.     * */    public ISRandomAccessIO(InputStream is, int size, int inc, int maxsize) {        if (size < 0 || inc <= 0 || maxsize <= 0 || is == null) {            throw new IllegalArgumentException();        }        this.is = is;        // Increase size by one to count in EOF        if (size < Integer.MAX_VALUE) size++;        buf = new byte[size];        this.inc = inc;        // The maximum size is one byte more, to allow reading the EOF.        if (maxsize < Integer.MAX_VALUE) maxsize++;        this.maxsize = maxsize;        pos = 0;        len = 0;        complete = false;    }    /**     * Creates a new RandomAccessIO wrapper for the given InputStream     * 'is'. The internal cache buffer size and increment is to to 256 kB. The     * maximum buffer size is set to Integer.MAX_VALUE (2 GB).     *     * @param is The input from where to get the data.     * */    public ISRandomAccessIO(InputStream is) {        this(is,1<<18,1<<18,Integer.MAX_VALUE);    }    /**     * Grows the cache buffer by 'inc', upto a maximum of 'maxsize'. The     * buffer size will be increased by at least one byte, if no exception is     * thrown.     *     * @exception IOException If the maximum cache size is reached or if not     * enough memory is available to grow the buffer.     * */    private void growBuffer() throws IOException {        byte newbuf[];        int effinc;           // effective increment        effinc = inc;        if (buf.length+effinc > maxsize) effinc = maxsize-buf.length;        if (effinc <= 0) {            throw new IOException("Reached maximum cache size ("+maxsize+")");        }        try {            newbuf = new byte[buf.length+inc];        } catch (OutOfMemoryError e) {            throw new IOException("Out of memory to cache input data");        }        System.arraycopy(buf,0,newbuf,0,len);        buf = newbuf;    }    /**     * Reads data from the wrapped InputStream and places it in the cache     * buffer. Reads all input data that will not cause it to block, but at     * least on byte is read (even if it blocks), unless EOF is reached. This     * method can not be called if EOF has been already reached     * (i.e. 'complete' is true). The wrapped InputStream is closed if the EOF     * is reached.     *     * @exception IOException An I/O error occurred, out of meory to grow     * cache or maximum cache size reached.     * */    private void readInput() throws IOException {        int n;        int b;        int k;        if (complete) {            throw new IllegalArgumentException("Already reached EOF");        }        n = is.available(); /* how much can we read without blocking? */        if (n == 0) n = 1;  /* read at least one byte (even if it blocks) */        while (len+n > buf.length) { /* Ensure buffer size */            growBuffer();        }        /* Read the data. Loop to be sure that we do read 'n' bytes */        do {            k = is.read(buf,len,n);            if (k > 0) { /* Some data was read */                len += k;                n -= k;            }        } while (n > 0 && k > 0);        if (k <= 0) { /* we reached EOF */            complete = true;            is.close();            is = null;        }    }    /**     * Closes this object for reading as well as the wrapped InputStream, if     * not already closed. The memory used by the cache is released.     *     * @exception IOException If an I/O error occurs while closing the     * underlying InputStream.       * */    public void close() throws IOException {        buf = null;        if (!complete) {            is.close();            is = null;        }    }    /**     * Returns the current position in the stream, which is the position from     * where the next byte of data would be read. The first byte in the stream     * is in position 0.     *     * @exception IOException If an I/O error occurred.     * */    public int getPos() throws IOException {        return pos;    }    /**     * Moves the current position for the next read operation to offset. The     * offset is measured from the beginning of the stream. If the offset is     * set beyond the currently cached data, the missing data will be read     * only when a read operation is performed. Setting the offset beyond the     * end of the data will cause an EOFException only if the data length is     * currently known, otherwise an IOException will occur when a read     * operation is attempted at that position.     *     * @param off The offset where to move to.     *     * @exception EOFException If seeking beyond EOF and the data length is     * known.     *     * @exception IOException If an I/O error ocurred.     * */    public void seek(int off) throws IOException {        if (complete) { /* we know the length, check seek is within length */            if (off > len) {                throw new EOFException();            }        }        pos = off;    }    /**     * Returns the length of the stream. This will cause all the data to be     * read. This method will block until all the data is read, which can be     * lengthy across the network.     *     * @return The length of the stream, in bytes.     *     * @exception IOException If an I/O error ocurred.       * */    public int length() throws IOException {        while (!complete) { /* read until we reach EOF */            readInput();        }        return len;    }    /**     * Reads a byte of data from the stream.     *     * @return The byte read, as an int in the range [0-255].     *     * @exception EOFException If the end-of file was reached.     *     * @exception IOException If an I/O error ocurred.     * */    public int read() throws IOException {        if (pos < len) { // common, fast case            return 0xFF & (int)buf[pos++];        }        // general case        while (!complete && pos >= len) {            readInput();        }        if (pos == len) {            throw new EOFException();        } else if (pos > len) {            throw new IOException("Position beyond EOF");        }        return 0xFF & (int)buf[pos++];    }    /**     * Reads 'len' bytes of data from this file into an array of bytes. This     * method reads repeatedly from the stream until all the bytes are     * read. This method blocks until all the bytes are read, the end of the     * stream is detected, or an exception is thrown.     *     * @param b The buffer into which the data is to be read. It must be long     * enough.     *     * @param off The index in 'b' where to place the first byte read.     *     * @param len The number of bytes to read.     *

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91一区二区在线观看| 亚洲成人av一区| 成人aa视频在线观看| 欧美韩国日本综合| 99久久er热在这里只有精品15| 亚洲日本va在线观看| 欧美四级电影网| 免费久久精品视频| 国产网红主播福利一区二区| 99视频精品在线| 亚洲一区二区三区四区不卡| 91精品久久久久久蜜臀| 黑人巨大精品欧美一区| 国产精品不卡在线观看| 欧美无人高清视频在线观看| 免费观看日韩av| 国产精品毛片久久久久久| 日本韩国精品一区二区在线观看| 亚洲va在线va天堂| 国产亚洲一区二区三区| 色综合网站在线| 久久精品国产久精国产爱| 国产精品久久久久三级| 欧美在线看片a免费观看| 久久国产尿小便嘘嘘| 国产精品日产欧美久久久久| 欧美日韩日日夜夜| 国产精品1区2区| 亚洲午夜一区二区三区| 精品成人a区在线观看| 色美美综合视频| 国产精品一区专区| 亚洲动漫第一页| 国产精品色眯眯| 91精品国产综合久久精品性色| 成人免费视频视频在线观看免费 | 欧美福利一区二区| 国产一区二区三区四| 亚洲一二三四在线| 欧美韩国一区二区| 精品国产免费视频| 欧美体内she精视频| aaa欧美色吧激情视频| 男人操女人的视频在线观看欧美| 亚洲天天做日日做天天谢日日欢| 欧美成人a∨高清免费观看| 色噜噜狠狠色综合欧洲selulu| 国产一本一道久久香蕉| 日韩精品一二三四| 亚洲精品免费一二三区| 久久精品男人的天堂| 欧美一级黄色录像| 欧美日韩免费观看一区二区三区| 成人在线综合网站| 国产综合久久久久久鬼色| 日本亚洲天堂网| 亚洲gay无套男同| 一级女性全黄久久生活片免费| 国产精品欧美久久久久无广告| 精品国产凹凸成av人网站| 91福利社在线观看| 色综合欧美在线视频区| 成人精品小蝌蚪| 国产电影精品久久禁18| 黄色日韩三级电影| 久久99热国产| 激情丁香综合五月| 美女精品自拍一二三四| 日本亚洲欧美天堂免费| 日韩不卡一区二区| 日本在线不卡视频一二三区| 亚洲一区视频在线观看视频| 亚洲综合在线免费观看| 亚洲另类在线制服丝袜| 一二三四社区欧美黄| 亚洲精品久久久久久国产精华液| 国产精品乱码一区二三区小蝌蚪| 国产网红主播福利一区二区| 国产精品午夜在线| 国产精品区一区二区三| 国产精品福利在线播放| 国产精品久久久久永久免费观看| 中文字幕在线观看不卡| 国产精品成人午夜| 亚洲一区二区三区国产| 亚洲一级电影视频| 日韩一区精品字幕| 精品一区二区免费视频| 狠狠狠色丁香婷婷综合激情| 国产成人av电影在线| 99久久久久久| 欧美老女人第四色| 精品久久99ma| 欧美国产一区二区| 亚洲欧美另类小说| 舔着乳尖日韩一区| 久久99国产精品尤物| 国产69精品久久99不卡| 91亚洲国产成人精品一区二区三| 在线免费视频一区二区| 欧美精品三级日韩久久| 精品国产一区二区亚洲人成毛片| 国产清纯在线一区二区www| 亚洲日本丝袜连裤袜办公室| 天天综合网天天综合色| 久久成人羞羞网站| 91天堂素人约啪| 日韩精品一区二| 亚洲三级电影网站| 日本欧美一区二区三区乱码 | 午夜精品久久久久| 九九精品一区二区| 色综合视频在线观看| 日韩久久久精品| 中文字幕日韩欧美一区二区三区| 一区二区三区四区激情| 久久精品国产在热久久| 色中色一区二区| 精品国产区一区| 亚洲成人免费看| 成人免费毛片app| 日韩亚洲欧美在线观看| 亚洲精品乱码久久久久| 精品一区二区三区免费观看 | 国产精品欧美久久久久一区二区| 亚洲香肠在线观看| 成人黄页在线观看| 日韩免费高清电影| 亚洲一级在线观看| 91在线视频免费91| 久久久亚洲综合| 日韩高清不卡一区二区三区| 99精品久久久久久| 欧美精品一区二区三区在线 | 国产一区中文字幕| 欧美乱熟臀69xxxxxx| 中文字幕免费一区| 久久99久久久久| 欧美日韩一区二区三区四区 | www.久久久久久久久| 日韩一区二区免费电影| 亚洲第一久久影院| 99视频国产精品| 国产欧美一区二区精品性色超碰| 免费看日韩精品| 91麻豆精品国产91久久久| 亚洲激情在线播放| 成人app软件下载大全免费| 久久亚洲捆绑美女| 乱中年女人伦av一区二区| 欧美日本在线看| 亚洲尤物视频在线| 欧美在线视频不卡| 一区二区日韩电影| 一本一道波多野结衣一区二区| 中文字幕高清一区| 国产麻豆精品theporn| 精品成人一区二区| 国产乱码精品一区二区三区忘忧草| 91精品在线免费观看| 日韩高清不卡一区| 777久久久精品| 日本欧洲一区二区| 日韩一区二区三区高清免费看看| 日韩av一二三| 日韩亚洲欧美中文三级| 精品综合久久久久久8888| 欧美成人女星排名| 国内精品伊人久久久久av影院| 精品国产乱码久久久久久老虎| 久久国产夜色精品鲁鲁99| 久久综合国产精品| 国产一区二区三区综合| 久久精品免视看| 成人av电影免费在线播放| 亚洲免费av在线| 在线观看www91| 男人操女人的视频在线观看欧美| 欧美一区二区在线免费观看| 裸体健美xxxx欧美裸体表演| 久久先锋资源网| av不卡免费电影| 亚洲成人自拍偷拍| 精品乱码亚洲一区二区不卡| 国产98色在线|日韩| 国产精品夫妻自拍| 欧美色视频一区| 久久99最新地址| 国产精品国产精品国产专区不蜜| av电影天堂一区二区在线观看| 亚洲国产日产av| 欧美mv日韩mv亚洲| 成人美女视频在线看| 亚洲观看高清完整版在线观看| 精品区一区二区| 色悠悠久久综合| 美女脱光内衣内裤视频久久网站| 中文字幕乱码一区二区免费| 欧美体内she精视频| 国产乱码精品一品二品|