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

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

?? wbxmldecoder.java~8~

?? jwap 協議 udp 可以用于手機通訊
?? JAVA~8~
?? 第 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一区二区三区免费野_久草精品视频
亚洲欧美日韩成人高清在线一区| 欧美精品欧美精品系列| 国产精品久久777777| 不卡的av在线播放| 中文天堂在线一区| 91视频精品在这里| 亚洲成人免费在线| 欧美一区二区三区电影| 国产一区二区调教| 亚洲国产精品99久久久久久久久| 国产成人亚洲综合a∨婷婷图片| 国产区在线观看成人精品| 成人va在线观看| 亚洲狠狠丁香婷婷综合久久久| 91久久国产综合久久| 一区二区三区免费在线观看| 欧美日韩一区二区在线观看视频| 人人爽香蕉精品| 国产欧美一区二区精品久导航 | 免费黄网站欧美| 欧美电影免费观看高清完整版在线观看| 免费视频一区二区| 久久久久国产精品厨房| 色94色欧美sute亚洲线路一ni | 成人激情免费电影网址| 亚洲一区二区免费视频| 欧美不卡在线视频| 91热门视频在线观看| 偷窥国产亚洲免费视频| 国产偷国产偷亚洲高清人白洁| 91欧美一区二区| 欧美aⅴ一区二区三区视频| 中文字幕的久久| 欧美一区在线视频| 成人免费电影视频| 日本成人在线一区| 中文字幕在线视频一区| 日韩精品中午字幕| 99re在线视频这里只有精品| 日本不卡一二三| 综合久久久久综合| 日韩亚洲国产中文字幕欧美| 99久久婷婷国产综合精品| 日韩和欧美一区二区三区| 国产日韩欧美在线一区| 911精品产国品一二三产区| 成人性视频网站| 九九九精品视频| 亚洲午夜精品一区二区三区他趣| 久久久久青草大香线综合精品| 欧美性生活一区| 成人午夜激情片| 精品一区二区三区不卡| 天堂久久一区二区三区| 一区二区三区在线观看视频| 欧美激情一区二区三区蜜桃视频 | 国产亚洲短视频| 这里只有精品免费| 色国产综合视频| 国产成人免费高清| 国产一区二区三区四区在线观看| 天堂va蜜桃一区二区三区| 亚洲日本一区二区| 亚洲国产精品黑人久久久| 精品盗摄一区二区三区| 欧美美女一区二区| 欧美日韩精品一区二区天天拍小说 | 欧美精品第一页| 日本韩国欧美一区二区三区| 不卡av在线免费观看| 国产精品一区久久久久| 韩国av一区二区三区四区| 蜜桃视频在线观看一区| 日本不卡视频在线| 美女视频黄a大片欧美| 午夜激情一区二区| 午夜精品一区二区三区三上悠亚| 一区二区三区丝袜| 亚洲视频一二区| 亚洲色图在线视频| 亚洲免费观看高清完整版在线观看熊| 国产精品午夜在线观看| 国产精品久久久久久久裸模| 国产精品对白交换视频| 亚洲视频一区在线| 亚洲伦理在线免费看| 亚洲一区在线观看网站| 亚洲第一狼人社区| 五月婷婷久久综合| 日韩激情一区二区| 免费人成在线不卡| 国产一区二区剧情av在线| 国产一区二区三区在线看麻豆| 黄色资源网久久资源365| 国产一区二区三区四区在线观看| 国产一区不卡精品| 成人黄动漫网站免费app| jvid福利写真一区二区三区| 一本久久综合亚洲鲁鲁五月天| 色哟哟日韩精品| 欧美日韩dvd在线观看| 日韩一二三区不卡| 久久久精品天堂| 中文字幕免费不卡| 一区二区三区在线观看动漫| 日韩av一区二区三区| 国产一区二区三区黄视频| 成人精品免费网站| 91成人免费电影| 日韩免费观看高清完整版| 欧美国产禁国产网站cc| 亚洲小说春色综合另类电影| 久久草av在线| 99久久久无码国产精品| 91精品中文字幕一区二区三区 | 久久久午夜电影| 亚洲人成小说网站色在线| 性欧美疯狂xxxxbbbb| 国产裸体歌舞团一区二区| 色婷婷激情综合| 26uuu色噜噜精品一区| 亚洲欧洲国产专区| 日韩精品亚洲专区| 91美女视频网站| 精品国精品国产| 亚洲在线成人精品| 国产美女在线精品| 69久久夜色精品国产69蝌蚪网| 日本一二三不卡| 亚洲一卡二卡三卡四卡五卡| 国产精品 日产精品 欧美精品| 91丨国产丨九色丨pron| 精品欧美黑人一区二区三区| 亚洲免费三区一区二区| 国产一区二区女| 欧美亚洲综合一区| 中文乱码免费一区二区| 日欧美一区二区| 色视频成人在线观看免| 亚洲尤物在线视频观看| 国产麻豆成人传媒免费观看| 欧美日韩国产乱码电影| 亚洲色图另类专区| 国产精品一区不卡| 日韩三级免费观看| 亚洲成av人片一区二区三区| 成人av网站免费观看| 日韩一区二区精品在线观看| 亚洲色图欧洲色图| 丰满少妇久久久久久久| 2014亚洲片线观看视频免费| 日本美女视频一区二区| 欧美在线观看视频一区二区| 国产精品高潮呻吟| 国产成人综合在线播放| 日韩视频一区二区三区| 偷拍日韩校园综合在线| 欧美日韩一区二区三区免费看| 亚洲欧美视频在线观看视频| 成人午夜激情视频| 国产精品久久久久久久久图文区| 精品一区二区三区久久久| 欧美另类videos死尸| 亚洲精品国产品国语在线app| 91天堂素人约啪| 亚洲欧洲制服丝袜| 94-欧美-setu| 国产精品美女久久久久aⅴ国产馆| 国产在线一区观看| 精品少妇一区二区三区| 蜜桃av噜噜一区二区三区小说| 欧美巨大另类极品videosbest | 国产欧美一区在线| 国产大陆a不卡| 国产日韩三级在线| 国产精品一区二区黑丝| 中文在线一区二区| 99麻豆久久久国产精品免费优播| 国产精品不卡一区二区三区| 色久综合一二码| 五月综合激情日本mⅴ| 欧美一级久久久| 国产一区久久久| 国产精品美女久久福利网站| 91麻豆福利精品推荐| 亚洲影院免费观看| 欧美一区二区在线看| 久久99精品久久久久久国产越南| 精品国产一区久久| 成人免费高清视频在线观看| 亚洲精品乱码久久久久久久久 | 亚洲乱码精品一二三四区日韩在线| av色综合久久天堂av综合| 亚洲人成精品久久久久| 欧美视频在线观看一区二区| 日本在线不卡一区| 国产日韩精品一区二区三区| 色综合天天综合网天天狠天天| 亚洲二区视频在线| 欧美精品一区二区三区视频|