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

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

?? connectioncompressed.java

?? 手機郵箱撒的方式方式方式的
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
package mujmail.connections;/*MujMail - Simple mail client for J2MECopyright (C) 2006 Nguyen Son Tung <n.sontung@gmail.com>This program is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2 of the License, or(at your option) any later version.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program; if not, write to the Free SoftwareFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */import java.io.*;import javax.microedition.io.*;import mujmail.Lang;import mujmail.MyException;/** * Implements ConnectionInterface that compress data. (Compression filter) * Now using RLE "compression". * No output buffering, no flush. * InOut is line oriented */ public class ConnectionCompressed implements ConnectionInterface {    /** Flag signals if we want to print debug prints */    private static final boolean DEBUG = false;        /** Connection to sending compressed data */    private ConnectorInterface connector = null;    /** Indicates whether is connection open or close */    private boolean connected = false;    private boolean quit = false;        /** String that identify compression type.     *  Note: Pointer to one of predefined constants, no content comparison     */    private String compression = COMPRESSION_TYPE_NONE; // None have to be default        /** Compression type identification constants */    /** No compression is used for communication. */    public static final String COMPRESSION_TYPE_NONE    = "NONE";    //#ifdef MUJMAIL_COMPRESSED_CONNECTION    /** Communication with server is compressed by RLE compression. */    public static final String COMPRESSION_TYPE_RLE     = "RLE";    /** Communication from server is compressed by GZIP compression. */    public static final String COMPRESSION_TYPE_GZIP    = "GZIP";    /** Communication initialization constants */    private static final String INIT_HELLO = "Xmujmail-compression";    private static final String INIT_VERSION = "0.5";    //#endif    /** Counts changes of compression type */    private static int counter = 0;        /** Count send data. Data incoming from higher level into send method */    private int dataSendIn = 0;    /** Count read data. Data gets to higher level from getLine method */    private int dataReadIn = 0;        private static final int BUFFER_LEN = 256;    /** Buffer for outgoing compression data */    private InOutBuffer buff = null;        private Object syncIn = new Object();    private Object syncOut = new Object();    /** Last that was take back */    private StringBuffer lastLine = new StringBuffer();    /** Mark whether we want to get the last line back or new data from buffer */    private boolean backMark;    /*** RLE Compression specifies stuff */    // Hold state of RLE from last stop    private char RLE_Char;    private int  RLE_Count = 0; // How many times put into output    /** Creates new socket connection.      * <p>{@link mujmail.connections.ConnectorSocket} are used for communication.     * <p>No compression is set at first.     */    public ConnectionCompressed() {        connector = new ConnectorSocket();        buff = new InOutBuffer( BUFFER_LEN, connector);    }    /**     * Construct connection proxy     * @param _connector Connector used for data delivery.      *          If null standard ConnectorSocket will be used.     * @param _compression Initial type of compression     *      */    public ConnectionCompressed(ConnectorInterface _connector, String _compression) {        if (_connector != null)             connector = _connector;        else            connector = new ConnectorSocket();        compression = _compression;        buff = new InOutBuffer( BUFFER_LEN, connector);    }            public synchronized void close() {        connected = false;        buff.InSkipBuffer(); // Flushing buffer        try {            if (connector != null) connector.close();        } catch (IOException ex) {            // Connection closing problem, let is connection closed by timeout        }        }    public synchronized void open(String url, boolean ssl, byte sslType) throws MyException {        if (connector == null) return;        compression = COMPRESSION_TYPE_NONE;        try {            connector.open(url, ssl, sslType);        } catch (ConnectionNotFoundException ex) {            ex.printStackTrace();            throw new MyException(MyException.COM_UNKNOWN, Lang.get( Lang.EXP_COM_UNKNOWN) + " Server not found." + ex.getMessage()); // Try to open invalid location        } catch (EOFException ex) {            ex.printStackTrace();            throw new MyException(MyException.COM_HALTED);        } catch (IOException ex) {            //System.out.println(ex.getMessage());            //ex.printStackTrace();            ex.printStackTrace();            throw new MyException(MyException.COM_HALTED, ex);        }        connected = true;    }        //#ifdef MUJMAIL_COMPRESSED_CONNECTION     /**      * Sets new compression type     *      * @param newCompression Compression type to uses.      *      It have to be one from predefined strings in class.     *      Test is done string addressed (not content)     * <p>     * Note: Checks if server counter support compression. Sends data into output.     */    public void changeCompression(String newCompression) throws MyException {        if (connector == null) return;    // Check if newCompression is supported         // Note not comparing strings but addresses        if ( (newCompression != COMPRESSION_TYPE_NONE) &&             (newCompression != COMPRESSION_TYPE_RLE) &&             (newCompression != COMPRESSION_TYPE_GZIP) ) {            return;        }        // GZIP compression cann't be changed unsupported        if ( (compression == COMPRESSION_TYPE_GZIP) &&              (newCompression != COMPRESSION_TYPE_GZIP) ) {            return;        }        // Place for preinitialization               // Setting compression        String tag = "compress" + counter++ + " ";        String command = tag + INIT_HELLO + " " + INIT_VERSION + " " + newCompression; // Add necessary compression type initialization informations if needed        String result = null;        String oldCompression = compression;        try {            sendCRLF(command);            result = getLine(); // Last line in old compression            while (!result.startsWith(tag)) { //multiline response                result = getLine();            }                        result = result.substring(tag.length());            if (result.startsWith("OK")) { // All correct - set parameters                compression = newCompression; // This have to be set here, to connector.flush works correctly                if (compression == COMPRESSION_TYPE_GZIP) {                    connector = new ConnectorGZip(connector, buff);                    buff.changeConnector(connector);                    connector.flush();                }                getLine(); // To read server reply "* compression OK"            }        } catch ( IOException ex) {            // We need close connection immediately,             //   because each side tries to use different compression            compression = oldCompression;            throw new MyException( MyException.COM_UNKNOWN, ex);         }    }    //#endif        public void sendCRLF(String command) throws MyException {        send((command + CRLF).getBytes());    }    /**     * Send line (or multiline) to server.     * @param command The line to be written.     * @throws MyException If connection is closed or transmission error     */    public void send(String command) throws MyException {       send(command.getBytes());    }         /**     * Buffer to server.     * @param command bytes to be sent     * @throws MyException if connection is closed or transmission error     * Note: Have to be synchronized ... share one instance of output buffer     */    public void send(byte[] command) throws MyException {        if (connector == null ) return;        if (command == null || command.length == 0) return;        if (quit) {            throw new MyException(MyException.COM_HALTED);        }                synchronized (syncIn) {            // Counting send (uncompressed)data             dataSendIn += command.length;                        //#ifdef MUJMAIL_COMPRESSED_CONNECTION            if (compression == COMPRESSION_TYPE_RLE) {                try {                    byte prevByte = command[0];                    int inBufPos = 1; // Position in input buffer -- command                    int prevByteCount = 1;                    while (inBufPos < command.length) {                        if (command[inBufPos] == prevByte) {                            // Same character as before                            inBufPos++;                            prevByteCount++;                                                        // Test if length of same char in not too long                            if (prevByteCount == 18) {                                // To many same character, put out sequence                                buff.OutAddByte((byte)(0xFF)); // Writes 17times same char                                buff.OutAddByte(prevByte);                                prevByteCount = 1;                            }                        } else {                            // Different character in the input --> write current run                            if ((command[inBufPos] & 0xF0) == 0xF0 || prevByteCount > 1) {                                // Longer run or problematic char --> double char code                                buff.OutAddByte((byte)(0xF0 + prevByteCount - 1));                                buff.OutAddByte(prevByte);                            } else {                                // Single non problematic char (not binary 1111????) -> one byte code                                buff.OutAddByte(prevByte);                             }                            // Read next char from input                            prevByte = command[inBufPos];                            prevByteCount = 1;                            inBufPos++;                        }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产福利一区在线观看| 亚洲午夜激情网页| 大尺度一区二区| 国产精品蜜臀av| 91丨九色丨蝌蚪丨老版| 亚洲一区二区精品视频| 正在播放亚洲一区| 国产精品香蕉一区二区三区| 国产免费成人在线视频| 色婷婷综合久久久久中文| 午夜精品久久久久久久蜜桃app| 日韩欧美一区二区视频| 成人免费的视频| 亚洲一级二级在线| 精品久久久久久无| caoporen国产精品视频| 亚州成人在线电影| 久久影院午夜论| 色综合天天在线| 青青国产91久久久久久| 国产精品美女久久久久久| 欧美自拍偷拍一区| 国产精品系列在线播放| 亚洲视频在线观看一区| 欧美一区二区三区四区高清| 成人永久免费视频| 亚洲福利一二三区| 国产午夜精品在线观看| 欧美三级电影精品| 成人午夜在线免费| 日韩高清电影一区| 亚洲三级免费电影| 久久久久国产精品人| 欧美日韩国产不卡| 成人avav影音| 蜜乳av一区二区三区| 亚洲女子a中天字幕| 久久久www成人免费毛片麻豆| 欧美在线观看一二区| 国产成人av影院| 免费在线观看精品| 亚洲激情图片小说视频| 欧美激情综合五月色丁香| 欧美一区二区三区色| 欧美图片一区二区三区| 国产精品一区二区三区乱码| 日韩国产在线观看一区| 中文字幕一区二区在线播放| 亚洲精品在线三区| 日韩一区二区在线免费观看| 日本道色综合久久| 99久久99久久免费精品蜜臀| 国产精品一线二线三线精华| 美女一区二区三区在线观看| 偷偷要91色婷婷| 一区二区三区**美女毛片| 国产精品你懂的| 国产日韩欧美麻豆| 欧美不卡一区二区三区四区| 欧美精品精品一区| 欧美日韩aaa| 欧美日韩成人综合在线一区二区| 色香蕉成人二区免费| 97精品久久久久中文字幕| 国产成人高清视频| 成人av先锋影音| 成人aaaa免费全部观看| 成人性视频网站| 成人国产精品视频| 成人精品电影在线观看| 成人一级片在线观看| 成人sese在线| 色综合视频一区二区三区高清| 99精品在线免费| 91麻豆福利精品推荐| 一本色道**综合亚洲精品蜜桃冫| 99视频国产精品| 99精品视频在线观看| 91丨九色丨国产丨porny| 99久久久久久| 欧美婷婷六月丁香综合色| 欧美精品精品一区| 日韩欧美中文字幕一区| 欧美mv和日韩mv的网站| 久久久午夜精品| 中文字幕免费一区| 亚洲黄色在线视频| 日日夜夜免费精品| 国产综合成人久久大片91| 成人中文字幕在线| 色婷婷精品久久二区二区蜜臂av | 99久久国产免费看| 91影院在线观看| 欧美日韩精品欧美日韩精品一| 欧美情侣在线播放| 欧美精品一区二区三区在线播放 | 91国产免费观看| 欧美日本视频在线| 欧美精品一区二区三区在线播放 | 奇米色777欧美一区二区| 国产在线精品一区二区夜色| caoporen国产精品视频| 欧美裸体一区二区三区| 欧美sm美女调教| 亚洲男帅同性gay1069| 日韩av在线播放中文字幕| 激情五月播播久久久精品| 91丨porny丨首页| 日韩一级二级三级| 日本一区免费视频| 亚洲成人av中文| 成人午夜伦理影院| 欧美日韩精品久久久| 久久综合九色综合97婷婷| 亚洲欧美国产毛片在线| 免费观看在线综合| 91色视频在线| 久久婷婷一区二区三区| 亚洲激情男女视频| 欧美日本高清视频在线观看| 国产麻豆成人传媒免费观看| 在线免费观看视频一区| 欧美mv日韩mv| 亚洲国产成人精品视频| 国产酒店精品激情| 欧美精品久久一区| 中文字幕一区二区三区不卡在线| 午夜精品久久久久影视| 91在线你懂得| 精品成人佐山爱一区二区| 欧美大片一区二区三区| 欧美精品国产精品| 成人欧美一区二区三区黑人麻豆| 蜜臀久久久久久久| 91久久久免费一区二区| 日本一区二区在线不卡| 寂寞少妇一区二区三区| 欧美日本韩国一区二区三区视频| 中文字幕在线观看一区| 国产一区二区三区| 欧美一区二区三区日韩视频| 亚洲国产日韩av| 91论坛在线播放| 中文字幕在线视频一区| 国产精品99久久久久久宅男| 欧美一级黄色大片| 婷婷开心久久网| 欧美视频日韩视频| 亚洲另类在线视频| av在线不卡免费看| 亚洲国产精品成人综合 | 欧美亚洲免费在线一区| 亚洲欧美激情一区二区| 99re免费视频精品全部| 国产精品久久久久久久久久免费看 | 一区二区三区免费网站| 成人性生交大片免费| 中文字幕高清一区| 国产成人福利片| 国产欧美日韩综合精品一区二区| 国产美女精品人人做人人爽| 久久一区二区三区国产精品| 精品一二三四区| 精品动漫一区二区三区在线观看| 蜜桃91丨九色丨蝌蚪91桃色| 日韩精品专区在线影院重磅| 精品在线视频一区| 久久免费午夜影院| 国产精品18久久久| 国产精品福利在线播放| jlzzjlzz亚洲日本少妇| 亚洲视频免费看| 欧美亚洲丝袜传媒另类| 日韩在线一二三区| 精品国产乱码久久久久久闺蜜| 国产精品影视天天线| 国产精品久久久久久久久果冻传媒| 99久久国产综合色|国产精品| 亚洲精品中文在线观看| 欧美日韩一区二区三区不卡 | 精品国产污网站| 国产精一区二区三区| 国产精品久久夜| 在线一区二区三区做爰视频网站| 亚洲制服丝袜在线| 欧美一区二区三区电影| 国内精品免费**视频| 国产精品污www在线观看| 色8久久人人97超碰香蕉987| 天堂va蜜桃一区二区三区漫画版| 精品久久五月天| 成人午夜激情视频| 亚洲影院理伦片| 日韩欧美在线综合网| 懂色av一区二区夜夜嗨| 亚洲欧美另类图片小说| 日韩一级片在线播放| 成人激情动漫在线观看| 亚洲国产成人va在线观看天堂| 日韩女优毛片在线|