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

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

?? wbxmldecoder.java~6~

?? jwap 協議 udp 可以用于手機通訊
?? JAVA~6~
?? 第 1 頁 / 共 2 頁
字號:
		byte maskedTokenValue = wbxmlStream.readByte();
		while (maskedTokenValue != 01) { // END (of parent element)
			byte actualTokenValue = getTokenValue(maskedTokenValue);
			if (isInlineStrToken(maskedTokenValue)) // element has text content
				writeContentAsInlineStr(parent);
			else {
				if (isEntityToken(actualTokenValue)) // element has entity
					writeEntityContent(parent);
				else if (maskedTokenValue == GlobalTokens.OPAQUE)
					// element contains opaque data
					writeOpaqueContent(parent);
				else if (isStringTableReferenceToken(maskedTokenValue)) {
					byte indexInStringTable = wbxmlStream.readByte();
					writeContentFromStrTable(parent, indexInStringTable);
				} else if (actualTokenValue == GlobalTokens.SWITCH_PAGE) {
					byte codepageNo = wbxmlStream.readByte();
					TokenRepository.setCurrentCodepage(codepageNo);
					// TODO specify namespace with xmlns attribute
				} else {
					String elementName =
						tokenRepository.getTagName(actualTokenValue);

					Element childElement =
						xmlDocument.createElement(elementName);
					//childElement.setPrefix(tokenRepository.getCurrentNamespace());
					parent.appendChild(childElement);
					if (hasAttributes(maskedTokenValue))
						setAttributes(childElement);
					if (hasContent(maskedTokenValue)) {
						writeChildElement(childElement);
						maskedTokenValue = wbxmlStream.readByte();
						continue;
					}
				}

			}
			maskedTokenValue = wbxmlStream.readByte();
		}
	}

	private void writeContentFromStrTable(
		Element parent,
		int indexInStringTable) {
		char c = 0x0;
		int endIndex =
			stringTable.toString().indexOf(
				new String(new char[] { c }),
				indexInStringTable);
		String content = stringTable.substring(indexInStringTable, endIndex);
		Text txtContent = xmlDocument.createTextNode(content);
		parent.appendChild(txtContent);
	}

	private boolean hasAttributes(byte tokenValue) {
		return ((tokenValue & attributeBitMask) == attributeBitMask);
	}

	private boolean hasContent(byte tokenValue) {
		return (tokenValue & parentBitMask) == parentBitMask;
	}

	private void setAttributes(Element element) throws IOException {
		byte attrTokenValue = wbxmlStream.readByte();
		String currentAttrName = "";
		while (attrTokenValue != 01) { // END (of attribue list)
			if (isInlineStrToken(attrTokenValue))
				writeAttrValueAsInlineStr(element, currentAttrName);
			else {
				if (isEntityToken(attrTokenValue))
					writeEntityAsAttribute(element, currentAttrName);
				else if (isStringTableReferenceToken(attrTokenValue)) {
					byte indexInStringTable = wbxmlStream.readByte();
					writeAttributeFromStrTable(
						element,
						currentAttrName,
						indexInStringTable);
				} else {
					if (isAttrNameToken(attrTokenValue))
						currentAttrName =
							writeAttribute(element, attrTokenValue);
					else {
						if (isAttrValueToken(attrTokenValue))
							writeAttrValue(
								element,
								currentAttrName,
								attrTokenValue);
					}
				}
			}
			attrTokenValue = wbxmlStream.readByte();
		}

	}

	private String writeAttribute(Element element, byte attrTokenValue) {
		String[] attributeNameAndPrefix =
			tokenRepository.getAttributeNameAndPrefix(attrTokenValue);
		String attributeValue = "";
		String attributeName = attributeNameAndPrefix[0].toString();
		boolean hasPrefix = attributeNameAndPrefix[1] != null;
		if (hasPrefix)
			attributeValue = attributeNameAndPrefix[1].trim();
		Attr attrNode = xmlDocument.createAttribute(attributeName);
		attrNode.setValue(attributeValue);
		element.setAttributeNode(attrNode);
		return attributeName;
	}

	private void writeAttrValue(
		Element element,
		String attrName,
		byte attrTokenValue)
		throws IOException {
		String partialAttrValue = element.getAttribute(attrName);
		String attrValue =
			partialAttrValue
				+ tokenRepository.getAttributeValue(attrTokenValue);
		element.setAttribute(attrName, attrValue);
	}

	private void writeAttributeFromStrTable(
		Element element,
		String attrName,
		byte indexInStringTable) {
		String partialAttrValue = element.getAttribute(attrName);
		char c = 0x0;
		int endIndex =
			stringTable.toString().indexOf(
				new String(new char[] { c }),
				indexInStringTable);
		String attrValue =
			partialAttrValue
				+ stringTable.substring(indexInStringTable, endIndex);
		element.setAttribute(attrName, attrValue);

	}

	private void writeAttrValueAsInlineStr(Element element, String attrName)
		throws IOException {
		byte aChar = wbxmlStream.readByte();
		byte[] content = new byte[1024];
		int count = 0;
		while (aChar != 0x0) {
			content[count++] = aChar;
			aChar = wbxmlStream.readByte();
		}

		String previous_value = element.getAttribute(attrName);
		StringBuffer attrValue =
			new StringBuffer(
				previous_value.equals("null") ? "" : previous_value);
		attrValue =
			attrValue.append(new String(content, 0, count, this.encoding));
		element.setAttribute(attrName, attrValue.toString());
	}

	private void writeEntityAsAttribute(Element element, String attrName)
		throws IOException {
		String previous_value = element.getAttribute(attrName);
		StringBuffer attrValue =
			new StringBuffer(
				previous_value.equals("null") ? "" : previous_value);

		byte aChar = wbxmlStream.readByte();
		while ((aChar & (byte) 0x80) == 0x80) {
			// is aChar's continuation flag(MSB) is on)
			aChar = (byte) (aChar & 0x7f); //extract remaining 7 bits;
			String str1 = Integer.toString(aChar, 2);
			attrValue.append(str1);
			aChar = wbxmlStream.readByte();
		}

		String str2 = Integer.toString(aChar, 2);
		// last byte in multiple byte format
		while (str2.length() < 7)
			str2 = "0" + str2;
		attrValue.append(str2);
		int multipleByteValue = Integer.parseInt(attrValue.toString(), 2);
		element.setAttribute(attrName, "&#" + multipleByteValue + ";");
	}

	private void writeContentAsInlineStr(Element element) throws IOException {
		byte aChar = wbxmlStream.readByte();
		byte[] content = new byte[1024];
		int count = 0;
		while (aChar != 0x0) {
			content[count++] = aChar;
			aChar = wbxmlStream.readByte();
		}
		String attrValue = new String(content, 0, count, this.encoding);
		Text txtContent = xmlDocument.createTextNode(attrValue);
		element.appendChild(txtContent);
	}

	private boolean isEntityToken(byte tokenValue) {
		return tokenValue == GlobalTokens.ENTITY;
		// todo for other global tokens
	}

	private boolean isStringTableReferenceToken(byte tokenValue) {
		return tokenValue == GlobalTokens.STR_T;
	}

	private void writeEntityContent(Element element) throws IOException {
		StringBuffer attrValue = new StringBuffer();
		byte aChar = wbxmlStream.readByte();
		while ((aChar & (byte) 0x80) == 0x80) {
			// is aChar's continuation flag(MSB) is on)
			aChar = (byte) (aChar & 0x7f); //extract remaining 7 bits;
			String str1 = Integer.toString(aChar, 2);
			attrValue.append(str1);
			aChar = wbxmlStream.readByte();
		}

		String str2 = Integer.toString(aChar, 2);
		// last byte in multiple byte format
		while (str2.length() < 7)
			str2 = "0" + str2;
		attrValue.append(str2);
		int multipleByteValue = Integer.parseInt(attrValue.toString(), 2);
		Text txtContent =
			xmlDocument.createTextNode(Integer.toString(multipleByteValue));
		element.appendChild(txtContent);
	}

	private void writeOpaqueContent(Element element) throws IOException {
		//	StringBuffer opaqueData = new StringBuffer();
		byte lengthOfOpaqueData = wbxmlStream.readByte();
		// TODO for multi-byte length
		byte[] opaqueDataBuf = new byte[lengthOfOpaqueData];
		for (int i = 0; i < lengthOfOpaqueData; i++) {
			opaqueDataBuf[i] = wbxmlStream.readByte();

		}
		byte b = wbxmlStream.readByte();
		while (b != 1) {
			b = wbxmlStream.readByte();
		}
		String opaqueDataStr = new String(opaqueDataBuf, this.encoding);
		Text txtContent = xmlDocument.createTextNode("");
		//System.out.println("Opaque____" + opaqueDataStr);
		element.appendChild(txtContent);
	}
	private boolean isInlineStrToken(byte tokenValue) {
		return tokenValue == GlobalTokens.STR_ISTR_I;
	}

	private boolean isAttrNameToken(byte tokenValue) {
		return (tokenValue >= 0); // tokenValue is positive implies MSB is 0
	}

	private boolean isAttrValueToken(byte tokenValue) {
		return (tokenValue < 0);
		// tokenValue is negative that implies MSB is 1
	}

	private byte getTokenValue(byte maskedTokenValue) {
		byte unmaskedTokenValue = (byte) (maskedTokenValue & ((byte) 0x3f));
		// 3f =~ 0011 1111
		return unmaskedTokenValue;
	}

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91在线视频观看| 在线不卡a资源高清| 欧美亚洲国产怡红院影院| 日韩一二三四区| 国产精品美女一区二区三区| 亚洲午夜一区二区| 国产很黄免费观看久久| 欧美日韩视频不卡| 一区二区中文视频| 国产美女精品人人做人人爽| 欧美性色欧美a在线播放| 欧美国产日韩a欧美在线观看| 丝袜亚洲另类丝袜在线| 91蜜桃婷婷狠狠久久综合9色| 欧美r级电影在线观看| 亚洲成人综合网站| 91一区二区三区在线观看| 久久精品人人做人人爽人人 | 欧美亚洲国产一卡| 国产精品夫妻自拍| 懂色av噜噜一区二区三区av| 精品国产sm最大网站免费看| 亚洲一区二区三区四区在线观看 | 国产乱一区二区| 91精品国产91久久综合桃花| 亚洲影院免费观看| 91麻豆蜜桃一区二区三区| 国产精品美女久久久久久久| 福利一区福利二区| 国产午夜精品久久久久久久| 视频在线观看一区二区三区| 日本午夜一本久久久综合| 欧美日韩一区中文字幕| 欧美韩国一区二区| 国产精品一级片在线观看| 精品国产乱子伦一区| 男人的天堂亚洲一区| 欧美一卡2卡3卡4卡| 美国毛片一区二区| 久久在线观看免费| 国产高清不卡一区| 国产精品视频一二三| gogo大胆日本视频一区| 亚洲欧美另类小说| 色94色欧美sute亚洲线路二| 亚洲小说春色综合另类电影| 欧美亚洲精品一区| 免费视频最近日韩| 2023国产精华国产精品| 国产成人av一区二区| 亚洲欧洲日韩av| 在线观看亚洲a| 欧美精三区欧美精三区| 中文av一区特黄| 亚洲理论在线观看| 韩国视频一区二区| 欧美日韩国产在线观看| 亚洲图片你懂的| 日本少妇一区二区| 99久久免费视频.com| 精品捆绑美女sm三区| 日韩影视精彩在线| 久久先锋影音av| 国产美女视频一区| 在线观看日韩国产| 美国精品在线观看| 国产精品传媒入口麻豆| 欧美日韩精品电影| 欧美精品一区二| 亚洲一区视频在线| 日本韩国精品一区二区在线观看| 午夜影视日本亚洲欧洲精品| 精品久久人人做人人爱| 91丨九色丨蝌蚪丨老版| 日韩主播视频在线| 国产精品欧美久久久久无广告| 精品1区2区3区| 粉嫩高潮美女一区二区三区 | 国产人成一区二区三区影院| 欧美亚洲国产一区在线观看网站| 国产精选一区二区三区| 亚洲一级电影视频| 久久久国产午夜精品| 欧美日韩国产在线观看| 岛国精品在线观看| 免费成人美女在线观看| 亚洲卡通动漫在线| 国产欧美日韩亚州综合| 欧美日韩三级视频| 99久久精品免费看国产| 国产中文一区二区三区| 午夜精品免费在线| 日韩三级高清在线| 美女一区二区在线观看| 伊人夜夜躁av伊人久久| 国产精品亲子伦对白| 精品蜜桃在线看| 欧美日韩国产不卡| 99精品欧美一区二区三区综合在线| 久久精品国产第一区二区三区| 亚洲一区视频在线观看视频| 日韩美女视频19| 国产日本欧洲亚洲| 337p日本欧洲亚洲大胆色噜噜| 欧美精品xxxxbbbb| 欧美喷潮久久久xxxxx| 91免费观看视频| av亚洲产国偷v产偷v自拍| 国产福利精品一区| 国内外成人在线| 久久99蜜桃精品| 男男视频亚洲欧美| 免费成人在线视频观看| 婷婷综合久久一区二区三区| 亚洲福利一区二区三区| 亚洲欧美日本在线| 一级女性全黄久久生活片免费| 亚洲三级在线播放| 亚洲视频在线一区观看| 亚洲三级电影网站| 亚洲精品国产成人久久av盗摄| 1024成人网色www| 亚洲乱码国产乱码精品精小说| 亚洲欧洲精品一区二区三区不卡| 国产精品免费视频观看| 亚洲女人的天堂| 亚洲一级二级三级| 日本91福利区| 国产精品综合在线视频| 成人理论电影网| 在线亚洲精品福利网址导航| 欧美日韩中文字幕一区| 日韩一级片在线播放| 久久综合av免费| 亚洲日本在线天堂| 天天亚洲美女在线视频| 久久se这里有精品| 成人美女视频在线观看| 欧美中文字幕久久| 日韩精品一区二区三区老鸭窝| 久久天天做天天爱综合色| 国产精品二三区| 亚洲国产欧美在线人成| 久久99精品久久久久久| 成人国产精品免费网站| 欧美日韩国产另类不卡| 精品成a人在线观看| 亚洲欧美激情在线| 青青草原综合久久大伊人精品| 国产成人精品1024| 欧美日韩一级二级三级| 国产亚洲午夜高清国产拍精品 | 成人一区二区三区| 在线观看视频一区二区| 日韩欧美国产成人一区二区| 国产精品美女一区二区| 亚洲成在人线在线播放| 成人动漫视频在线| 欧美精品久久一区| 国产精品超碰97尤物18| 美女脱光内衣内裤视频久久网站| 波多野结衣在线aⅴ中文字幕不卡| 欧美亚洲一区三区| 久久你懂得1024| 精品福利一二区| 亚洲精品国产精华液| 久久99精品久久只有精品| 老色鬼精品视频在线观看播放| 成人午夜激情视频| 欧美日韩免费观看一区二区三区 | 欧美三级蜜桃2在线观看| 欧美精品一区二区三区四区| 中文字幕av一区二区三区高| 亚洲精品国产精品乱码不99| 精品无码三级在线观看视频| 99久久99久久免费精品蜜臀| 日韩一卡二卡三卡四卡| 久久免费国产精品| 免费在线欧美视频| 在线亚洲+欧美+日本专区| 久久毛片高清国产| 免费欧美高清视频| 色8久久精品久久久久久蜜| 久久久午夜精品理论片中文字幕| 樱桃国产成人精品视频| 国产成人综合在线播放| 欧美丰满美乳xxx高潮www| 成人免费在线视频观看| 国产一区二区导航在线播放| 欧美老女人第四色| 亚洲精选一二三| 国产99久久久精品| 日韩精品资源二区在线| 亚洲国产精品麻豆| 91在线小视频| 欧美成人一区二区三区在线观看 | 麻豆专区一区二区三区四区五区| 91在线一区二区三区| 国产日本亚洲高清| 国产美女在线精品|