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

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

?? disconnectpacket.java.svn-base

?? 類似QQ的功能
?? SVN-BASE
字號:
/******************************************************************************* Jimm - Mobile Messaging - J2ME ICQ clone Copyright (C) 2003-05  Jimm Project This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the 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 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. ******************************************************************************** File: src/jimm/comm/DisconnectPacket.java Version: ###VERSION###  Date: ###DATE### Author(s): Manuel Linsmayer, Andreas Rossbacher *******************************************************************************/package jimm.comm;import jimm.JimmException;public class DisconnectPacket extends Packet{	// Packet types	public static final int TYPE_SRV_COOKIE = 1;	public static final int TYPE_SRV_GOODBYE = 2;	public static final int TYPE_CLI_GOODBYE = 3;	// UIN as string (== null for CLI_GOODBYE packets)	protected String uin;	// Server (!= null only for SRV_COOKIE packets)	protected String server;	// Cookie (!= null only for SRV_COOKIE packets)	protected byte[] cookie;	// Reason for disconnect as an error code (>= 0 only for SRV_DISCONNECT packets)	protected int error;	// Reason for disconnect as a string (!= null only for SRV_DISCONNECT packets)	protected String description;	// Constructs a SRV_COOKIE packet	public DisconnectPacket(int sequence, String uin, String server,			byte[] cookie)	{		this.sequence = sequence;		this.uin = uin;		this.server = server;		this.cookie = new byte[cookie.length];		System.arraycopy(cookie, 0, this.cookie, 0, cookie.length);		this.error = -1;		this.description = null;	}	// Constructs a SRV_GOODBYE packet	public DisconnectPacket(int sequence, int error, String description)	{		this.sequence = sequence;		this.uin = null;		this.server = null;		this.cookie = null;		this.error = error;		this.description = new String(description);	}	// Constructs a SRV_GOODBYE packet	public DisconnectPacket(int error, String description)	{		this(-1, error, description);	}	// Constructs a CLI_GOODBYE packet	public DisconnectPacket(int sequence)	{		this.sequence = sequence;		this.uin = null;		this.server = null;		this.cookie = null;		this.error = -1;		this.description = null;	}	// Constructs a CLI_GOODBYE packet	public DisconnectPacket()	{		this(-1);	}	// Returns the packet type	public int getType()	{		if (this.uin != null)		{			return (DisconnectPacket.TYPE_SRV_COOKIE);		} else if (this.error >= 0)		{			return (DisconnectPacket.TYPE_SRV_GOODBYE);		} else		{			return (DisconnectPacket.TYPE_CLI_GOODBYE);		}	}	// Returns the uin, or null if packet type is not SRV_COOKIE	public String getUin()	{		if (this.getType() == DisconnectPacket.TYPE_SRV_COOKIE)		{			return this.uin;		} else		{			return (null);		}	}	// Returns the server, or null if packet type is not SRV_COOKIE	public String getServer()	{		if (this.getType() == DisconnectPacket.TYPE_SRV_COOKIE)		{			return this.server;		} else		{			return (null);		}	}	// Returns the cookie, or null if packet type is not SRV_COOKIE	public byte[] getCookie()	{		if (this.getType() == DisconnectPacket.TYPE_SRV_COOKIE)		{			byte[] cookie = new byte[this.cookie.length];			System.arraycopy(this.cookie, 0, cookie, 0, this.cookie.length);			return (cookie);		} else		{			return (null);		}	}	// Returns the error as an error code, or -1 if packet type is not SRV_GOODBYE	public int getError()	{		if (this.getType() == DisconnectPacket.TYPE_SRV_GOODBYE)		{			return (this.error);		} else		{			return (-1);		}	}	// Returns the reason for disconnect as a string, or null if packet type is not SRV_GOODBYE	public String getDescription()	{		if (this.getType() == DisconnectPacket.TYPE_SRV_GOODBYE)		{			return this.description;		} else		{			return (null);		}	}	// Returns the package as byte array	public byte[] toByteArray()	{		// Get package length		int length = 6;		if (this.getType() == DisconnectPacket.TYPE_SRV_COOKIE)		{			length += 4 + this.uin.length();			length += 4 + this.server.length();			length += 4 + this.cookie.length;		} else if (this.getType() == DisconnectPacket.TYPE_SRV_GOODBYE)		{			length += 4 + 2;			length += 4 + this.description.length();		}		// Allocate memory		byte[] buf = new byte[length];		// Assemble FLAP header		Util.putByte(buf, 0, 0x2A); // FLAP.ID		Util.putByte(buf, 1, 0x04); // FLAP.CHANNEL		Util.putWord(buf, 2, this.sequence); // FLAP.SEQUENCE		Util.putWord(buf, 4, length - 6); // FLAP.LENGTH		// Marker		int pos = 6;		// Assemble SRV_COOKIE		if (this.getType() == DisconnectPacket.TYPE_SRV_COOKIE)		{			// DISCONNECT.UIN			Util.putWord(buf, pos, 0x0001);			Util.putWord(buf, pos + 2, this.uin.length());			byte[] uinRaw = Util.stringToByteArray(this.uin);			System.arraycopy(uinRaw, 0, buf, pos + 4, uinRaw.length);			pos += 4 + uinRaw.length;			// DISCONNECT.SERVER			Util.putWord(buf, pos, 0x0005);			Util.putWord(buf, pos + 2, this.server.length());			byte[] serverRaw = Util.stringToByteArray(this.server);			System.arraycopy(serverRaw, 0, buf, pos + 4, serverRaw.length);			pos += 4 + serverRaw.length;			// DISCONNECT.COOKIE			Util.putWord(buf, pos, 0x0006);			Util.putWord(buf, pos + 2, this.cookie.length);			System.arraycopy(this.cookie, 0, buf, pos + 4, cookie.length);		}		// Assemble SRV_GOODBYE		else if (this.getType() == DisconnectPacket.TYPE_SRV_GOODBYE)		{			// DISCONNECT.UIN			Util.putWord(buf, pos, 0x0001);			Util.putWord(buf, pos + 2, this.uin.length());			byte[] uinRaw = Util.stringToByteArray(this.uin);			System.arraycopy(uinRaw, 0, buf, pos + 4, uinRaw.length);			pos += 4 + uinRaw.length;			// DISCONNECT.DESCRIPTION			Util.putWord(buf, pos, 0x0004);			Util.putWord(buf, pos + 2, this.description.length());			byte[] descriptionRaw = Util.stringToByteArray(this.description);			System.arraycopy(descriptionRaw, 0, buf, pos + 4,					descriptionRaw.length);			// DISCONNECT.ERROR			Util.putWord(buf, pos, 0x0008);			Util.putWord(buf, pos + 2, 0x0002);			Util.putWord(buf, pos + 4, this.error);			pos += 4 + 2;		}		// Return		return (buf);	}	// Parses given byte array and returns a Packet object	public static Packet parse(byte[] buf, int off, int len)			throws JimmException	{		// Get FLAP sequence number		int flapSequence = Util.getWord(buf, off + 2);		// Get length of FLAP data		//int flapLength = Util.getWord(buf, off + 4);		// Variables for all possible TLVs		String uin = null;		String server = null;		byte[] cookie = null;		int error = -1;		String description = null;		// Read all TLVs		int marker = off + 6;		while (marker < (off + len))		{			// Get next TLV			byte[] tlvValue = Util.getTlv(buf, marker);			if (tlvValue == null)			{				throw (new JimmException(135, 0));			}			// Get type of next TLV			int tlvType = Util.getWord(buf, marker);			// Update markers			marker += 4 + tlvValue.length;			// Save value			switch (tlvType)			{			case 0x0001: // uin				uin = Util.byteArrayToString(tlvValue);				break;			case 0x0005: // server				server = Util.byteArrayToString(tlvValue);				break;			case 0x0006: // cookie				cookie = tlvValue;				break;			case 0x0008: // error			case 0x0009: // error				error = Util.getWord(tlvValue, 0);				break;			case 0x0004: // description			case 0x000B: // description				description = Util.byteArrayToString(tlvValue);				break;			default: // Do nothing on default (ignore all unknown TLVs)			}		}		// CLI_GOODBYE		if ((uin == null) && (server == null) && (cookie == null)				&& (error == -1) && (description == null))		{			return (new DisconnectPacket(flapSequence));		}		// SRV_COOKIE		else if ((uin != null) && (server != null) && (cookie != null)				&& (error == -1) && (description == null))		{			return (new DisconnectPacket(flapSequence, uin, server, cookie));		}		// SRV_GOODBYYE		else if ((server == null) && (cookie == null) && (error != -1)				&& (description != null))		{			return (new DisconnectPacket(flapSequence, error, description));		}		// Other TLV combinations are not valid		else		{			throw (new JimmException(135, 2));		}	}	// Parses given byte array and returns a Packet object	public static Packet parse(byte[] buf) throws JimmException	{		return (DisconnectPacket.parse(buf, 0, buf.length));	}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
爽好久久久欧美精品| 精品福利一二区| 欧美午夜片在线观看| 97国产一区二区| 一本一本大道香蕉久在线精品 | 中文字幕中文乱码欧美一区二区 | 国产日韩精品一区二区三区在线| 久久综合中文字幕| 中文字幕乱码一区二区免费| 中文字幕一区二区三区在线播放| 一区二区三区中文字幕电影| 奇米精品一区二区三区在线观看| 国产成人av在线影院| 欧美人与z0zoxxxx视频| 日本一区二区视频在线观看| 亚洲综合在线五月| 国产91清纯白嫩初高中在线观看 | 色综合天天综合网天天狠天天| 91 com成人网| 成人高清视频在线| 国产精品国产三级国产普通话99| 91丨国产丨九色丨pron| 亚洲影视在线播放| 精品成a人在线观看| av福利精品导航| 2023国产精品| 丰满放荡岳乱妇91ww| 欧美激情一区二区| 国产乱码精品一区二区三| 欧美一区二区美女| 天涯成人国产亚洲精品一区av| 成人av免费在线播放| 中文字幕欧美日韩一区| 国产精品综合二区| 国产欧美一区二区精品仙草咪| 国内精品国产三级国产a久久| 在线播放一区二区三区| 亚洲狠狠丁香婷婷综合久久久| 亚洲九九爱视频| aaa国产一区| 中文字幕一区av| 91亚洲精品乱码久久久久久蜜桃| 欧美精品一区二区三区蜜臀| 国内精品在线播放| 欧美日韩国产另类不卡| 中文字幕一区二区三区精华液| 国产麻豆欧美日韩一区| 国产欧美日韩三区| 粉嫩av一区二区三区| 国产精品少妇自拍| www.66久久| 亚洲自拍偷拍欧美| 欧美在线观看一区二区| 亚洲3atv精品一区二区三区| 日韩一区二区三区四区五区六区 | 麻豆精品蜜桃视频网站| 欧美日韩国产高清一区二区三区| 一区二区三区在线免费观看| 91福利精品第一导航| 一区二区不卡在线播放 | 久久综合九色综合97_久久久| 青青草国产成人av片免费| 欧美大片在线观看一区二区| 免费观看在线色综合| 国产精品你懂的| 欧美影院一区二区| 国产乱子轮精品视频| 视频一区在线视频| 日韩高清中文字幕一区| 亚洲综合激情网| 亚洲福利一区二区| 久久久www免费人成精品| 91精品国产91久久久久久最新毛片 | 另类小说欧美激情| 中文字幕亚洲欧美在线不卡| 在线播放91灌醉迷j高跟美女| 成人久久18免费网站麻豆| 免费观看在线色综合| 亚洲一区二区在线播放相泽| 亚洲欧洲精品一区二区三区不卡| 91精品国产91久久久久久最新毛片| 99国产麻豆精品| 在线视频国内自拍亚洲视频| 91免费视频网址| 91丨九色丨蝌蚪富婆spa| yourporn久久国产精品| 成人v精品蜜桃久久一区| 福利91精品一区二区三区| 国产一区日韩二区欧美三区| 精品一二三四在线| 国产精品18久久久久久vr| 日韩国产一区二| 韩国一区二区三区| 成人97人人超碰人人99| 丁香婷婷综合网| 91首页免费视频| 欧美精品乱码久久久久久按摩 | 美国欧美日韩国产在线播放| 久久精品国产99| 美国三级日本三级久久99| 国产精品一区一区| 在线免费视频一区二区| 欧美日韩高清一区二区不卡 | 日韩女优制服丝袜电影| 欧美日韩精品欧美日韩精品| 欧美精品一区二区三区一线天视频| 久久精品亚洲乱码伦伦中文| 亚洲欧美另类久久久精品2019| 国产精品久久三| 秋霞影院一区二区| 成人av网站在线观看免费| 欧美日韩不卡视频| 日韩欧美国产一区二区三区| 中文字幕亚洲成人| 久久国产精品露脸对白| 色先锋久久av资源部| 91在线视频网址| 国产日韩v精品一区二区| 亚洲成精国产精品女| 国产美女av一区二区三区| 欧美日韩国产美女| 中文字幕一区二区三中文字幕| 日韩av一级片| 欧美日韩高清不卡| 亚洲欧美日韩国产另类专区| 高清成人免费视频| 精品国产91久久久久久久妲己| 日日摸夜夜添夜夜添精品视频| 91黄色免费看| 亚洲国产成人91porn| 91国产丝袜在线播放| 亚洲靠逼com| 欧美色图激情小说| 一区二区三区在线看| 国产一区二区在线视频| 69堂国产成人免费视频| 中文字幕av免费专区久久| 国产精品一区在线观看你懂的| 精品入口麻豆88视频| 韩国av一区二区三区在线观看| 日韩精品一区二区三区蜜臀| 老司机精品视频导航| 久久久久综合网| 色天使色偷偷av一区二区 | 88在线观看91蜜桃国自产| 一区二区中文视频| 欧美色图第一页| 精品一区二区久久久| 亚洲黄一区二区三区| 欧美中文字幕一区二区三区亚洲| 国产精品888| 欧美一区二区女人| 国产一区二区三区四区五区美女| 久久综合久久鬼色| av电影天堂一区二区在线| 五月激情六月综合| 国产精品久久久久久妇女6080| 欧美肥妇bbw| 波多野结衣欧美| 激情久久五月天| 亚洲国产欧美在线| 欧美高清在线精品一区| 7777女厕盗摄久久久| 99久久婷婷国产| 国产夫妻精品视频| 奇米综合一区二区三区精品视频 | 精品久久久久久久人人人人传媒| 91在线免费播放| 成人免费三级在线| 国产精品1024| 国产一区二区三区免费在线观看| 亚洲地区一二三色| 亚洲国产视频a| 亚洲国产精品影院| 亚洲制服丝袜av| 亚洲综合色噜噜狠狠| 亚洲国产精品一区二区久久| 18成人在线观看| 亚洲综合视频在线观看| 亚洲福利国产精品| 日韩成人午夜电影| 极品少妇一区二区| 东方aⅴ免费观看久久av| 不卡av在线免费观看| 色999日韩国产欧美一区二区| 在线精品视频小说1| 欧美一区二区三区四区高清| 精品国免费一区二区三区| 久久久久久久性| 亚洲自拍偷拍av| 国产毛片精品国产一区二区三区| 丁香网亚洲国际| 91精品一区二区三区在线观看| 久久先锋影音av鲁色资源| 亚洲欧美日韩系列| 国产又粗又猛又爽又黄91精品| 欧美在线观看视频在线| xfplay精品久久| 国产精品一区二区视频| 国产欧美精品一区|