亚洲欧美第一页_禁久久精品乱码_粉嫩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久久精品国产91性色tv| 日韩一区二区麻豆国产| 欧美日韩在线一区二区| 欧美精品一区二区三区在线| 亚洲三级电影全部在线观看高清| 七七婷婷婷婷精品国产| 日本丰满少妇一区二区三区| 精品国产一区二区三区av性色| 亚洲久本草在线中文字幕| 国产精品夜夜嗨| 91精品福利在线一区二区三区| 亚洲欧美在线视频| 国产91色综合久久免费分享| 91超碰这里只有精品国产| 亚洲另类中文字| 成人精品视频.| 久久久精品黄色| 麻豆精品新av中文字幕| 91精品国产免费| 午夜视频久久久久久| 色先锋资源久久综合| 中文字幕一区二区三区在线播放| 国产综合久久久久影院| 欧美电影免费提供在线观看| 三级欧美在线一区| 欧美美女直播网站| 亚洲一卡二卡三卡四卡| 欧美又粗又大又爽| 亚洲色图清纯唯美| 一本久道久久综合中文字幕| 国产精品久久一级| hitomi一区二区三区精品| 国产欧美一区二区三区鸳鸯浴| 国内精品第一页| 久久色中文字幕| 国产高清精品在线| 中文子幕无线码一区tr| 成人中文字幕电影| 国产精品每日更新| 色诱亚洲精品久久久久久| 亚洲精品美国一| 欧美系列日韩一区| 日韩电影在线一区二区| 欧美精品在线一区二区| 欧美bbbbb| 久久综合久久综合亚洲| 成人一区二区三区中文字幕| 国产精品入口麻豆九色| 91小视频在线免费看| 亚洲精品乱码久久久久| 欧美性感一类影片在线播放| 日本亚洲天堂网| 久久你懂得1024| 91性感美女视频| 日一区二区三区| 国产天堂亚洲国产碰碰| 99久久99久久精品国产片果冻| 亚洲永久精品国产| 日韩欧美国产综合一区 | 懂色av一区二区夜夜嗨| 亚洲国产成人一区二区三区| 91日韩在线专区| 日韩高清不卡在线| 中文在线一区二区| 欧美日本免费一区二区三区| 精品一区二区在线观看| 亚洲欧美日韩在线播放| 91精品国产综合久久小美女| 国产98色在线|日韩| 亚洲午夜成aⅴ人片| 久久久五月婷婷| 欧美在线你懂得| 国产精品亚洲视频| 亚洲福利视频导航| 欧美国产激情一区二区三区蜜月| 91福利视频网站| 国产精品资源网| 婷婷成人激情在线网| 欧美国产欧美综合| 日韩一区二区高清| 色偷偷一区二区三区| 国产在线播精品第三| 亚洲成人av福利| 国产精品国产三级国产aⅴ无密码| 欧美精品 国产精品| 99r国产精品| 国产精品一区二区在线观看不卡| 午夜成人在线视频| 国产精品乱子久久久久| 26uuu久久综合| 69久久99精品久久久久婷婷| 91福利在线看| 972aa.com艺术欧美| 日本不卡一区二区| 一区二区久久久| 亚洲国产精品精华液ab| 欧美mv日韩mv国产网站app| 欧美三级电影网| 色欧美日韩亚洲| 91在线观看高清| 国产成都精品91一区二区三 | 亚洲三级理论片| 亚洲国产精品精华液2区45| 精品国产乱码久久久久久久久| 欧美视频完全免费看| 色综合久久中文字幕| 成年人网站91| www.久久久久久久久| 大胆亚洲人体视频| 岛国精品在线观看| 国产成人av影院| 国产成人免费xxxxxxxx| 国产麻豆精品theporn| 国产美女一区二区三区| 经典三级视频一区| 国产伦理精品不卡| 国产美女精品人人做人人爽| 久久 天天综合| 国产在线国偷精品产拍免费yy| 激情综合网最新| 国产剧情在线观看一区二区 | 日韩高清国产一区在线| 日韩电影免费在线| 免费成人在线观看视频| 久久激五月天综合精品| 韩日欧美一区二区三区| 国产精品综合视频| av中文一区二区三区| 色狠狠综合天天综合综合| 欧洲精品一区二区| 制服丝袜成人动漫| 欧美成人精品3d动漫h| 国产亚洲一二三区| 亚洲欧洲日本在线| 亚洲国产一二三| 精品一区二区成人精品| 国产成人精品亚洲午夜麻豆| 99天天综合性| 欧美日韩一区二区在线视频| 欧美一级淫片007| 精品国产乱码久久久久久久 | 一级精品视频在线观看宜春院 | av电影天堂一区二区在线观看| 94-欧美-setu| 在线一区二区三区四区| 在线观看91精品国产麻豆| 欧美精品一区二区三区很污很色的| 国产日韩欧美制服另类| 一片黄亚洲嫩模| 久久精品国产999大香线蕉| 成人小视频在线观看| 欧美日韩免费视频| 国产欧美一区二区精品性色超碰| 亚洲日本青草视频在线怡红院| 午夜一区二区三区视频| 国产精品66部| 欧美日韩国产电影| 久久精品夜色噜噜亚洲aⅴ| 一区二区三区国产精品| 极品少妇xxxx偷拍精品少妇| 91黄色小视频| 国产三级欧美三级日产三级99| 亚洲一二三四区| 国产成人在线色| 日韩一区二区三区观看| 亚洲视频一二三区| 国产乱对白刺激视频不卡| 欧美三区在线观看| 中文字幕免费一区| 日本中文一区二区三区| 色偷偷成人一区二区三区91 | 日韩毛片精品高清免费| 精品一区二区影视| 欧美日韩一卡二卡三卡 | 91在线观看美女| 国产亚洲一区二区三区在线观看| 亚洲国产日韩一区二区| 成人久久18免费网站麻豆| 日韩欧美国产wwwww| 一级女性全黄久久生活片免费| 成人免费视频播放| 久久夜色精品国产欧美乱极品| 日日夜夜精品视频免费| 欧美性xxxxx极品少妇| 日韩毛片视频在线看| 国产成人综合视频| 久久综合国产精品| 免费不卡在线观看| 欧美一区二区三区视频| 午夜激情久久久| 欧美日韩国产123区| 亚洲人成影院在线观看| www.爱久久.com| 中文av一区特黄| 成人免费视频视频| 国产精品久久久久影视| 成人午夜视频在线观看| 欧美国产日韩在线观看| 成人动漫在线一区| 国产精品国产精品国产专区不蜜 |