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

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

?? wbxmldecoder.java~7~

?? jwap 協議 udp 可以用于手機通訊
?? JAVA~7~
?? 第 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一区二区三区免费野_久草精品视频
日韩午夜av一区| 福利一区在线观看| 欧美日本一区二区| 日韩专区在线视频| 欧美电影免费观看高清完整版在线观看| 天天综合网 天天综合色| 欧美日韩成人一区| 国产精品一区二区在线播放| 国产欧美日韩不卡免费| 成人av网址在线| 亚洲专区一二三| 69堂精品视频| 成人美女视频在线看| 一区二区三区毛片| 日韩欧美国产一区二区三区 | 国产一区二区福利| 国产精品久久久久aaaa| 欧美亚洲综合一区| 久久99久久久欧美国产| 国产精品久久久久影院色老大| 色哟哟一区二区在线观看| 免费的成人av| 国产精品久久久久一区二区三区| 欧美三级视频在线| 黄色日韩网站视频| 一区二区在线看| 久久夜色精品一区| 色综合中文字幕| 国产一区二区美女诱惑| 亚洲国产精品久久人人爱蜜臀| 精品国产亚洲一区二区三区在线观看| 成人精品视频一区| 蜜臀av一区二区三区| 最新成人av在线| 日韩美女一区二区三区| 在线精品视频一区二区| 成人亚洲精品久久久久软件| 亚洲小少妇裸体bbw| 国产精品午夜在线| 欧美一区二区成人6969| 欧美一级二级三级蜜桃| 99视频在线观看一区三区| 麻豆精品一区二区三区| 亚洲美女电影在线| 国产日产欧美一区二区视频| 这里只有精品视频在线观看| 色婷婷激情一区二区三区| 国产一区二区三区四| 午夜久久久久久久久| 中文字幕一区二区三区在线播放 | 337p日本欧洲亚洲大胆色噜噜| 欧洲精品一区二区| 99精品桃花视频在线观看| 国产成人av在线影院| 另类成人小视频在线| 午夜精品久久久久久久久| 亚洲女性喷水在线观看一区| 中文字幕av在线一区二区三区| 日韩欧美123| 69精品人人人人| 欧美日韩精品高清| 欧美午夜宅男影院| 色94色欧美sute亚洲线路二 | 捆绑调教美女网站视频一区| 亚洲123区在线观看| 一级特黄大欧美久久久| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 精品国产91乱码一区二区三区| 91精品国产欧美日韩| 欧美久久久久久久久中文字幕| 日本道精品一区二区三区| 色婷婷综合久久久中文一区二区 | 在线视频欧美精品| 在线视频一区二区三区| 91久久国产最好的精华液| 91最新地址在线播放| 色综合激情久久| 欧美午夜精品一区| 欧美乱熟臀69xxxxxx| 日韩三级在线免费观看| 日韩精品在线一区| 久久久欧美精品sm网站| 国产精品乱码一区二三区小蝌蚪| 日本一区二区三区高清不卡| 亚洲国产成人私人影院tom| 国产欧美日韩精品a在线观看| 国产精品天干天干在线综合| 国产精品免费av| 亚洲精品久久久久久国产精华液| 亚洲一区二区三区中文字幕 | 国产日本欧洲亚洲| 中文字幕欧美激情| 亚洲另类春色国产| 午夜影院在线观看欧美| 麻豆成人免费电影| 国产 欧美在线| 色视频一区二区| 3d动漫精品啪啪一区二区竹菊| 欧美α欧美αv大片| 国产精品美女一区二区在线观看| 综合久久久久综合| 日日骚欧美日韩| 国产乱妇无码大片在线观看| 91女神在线视频| 欧美老肥妇做.爰bbww| 久久综合色8888| 亚洲精品精品亚洲| 日韩在线一区二区三区| 国产一区三区三区| 欧美专区亚洲专区| 精品成人免费观看| 亚洲综合丝袜美腿| 国产精品白丝jk黑袜喷水| 色综合久久天天| 欧美成人官网二区| 亚洲欧洲综合另类| 久久99日本精品| 欧美影院一区二区三区| 久久久久青草大香线综合精品| 亚洲精品五月天| 国产一区二区三区黄视频 | 777奇米成人网| 日本一区二区三区dvd视频在线| 亚洲一卡二卡三卡四卡五卡| 激情欧美一区二区三区在线观看| 色婷婷狠狠综合| 久久久久久久免费视频了| 亚洲国产欧美在线人成| 成人动漫一区二区在线| 日韩欧美亚洲另类制服综合在线| 亚洲同性gay激情无套| 久久99国产精品免费| 欧美日韩久久不卡| 日韩伦理免费电影| 国产精品一区二区久久不卡| 欧美另类一区二区三区| 亚洲色图欧洲色图婷婷| 国产福利一区在线观看| 日韩欧美不卡在线观看视频| 亚洲第一二三四区| 一本色道亚洲精品aⅴ| 国产欧美日韩三级| 国内成人免费视频| 制服丝袜av成人在线看| 亚洲综合久久久| 99re在线精品| 中文字幕永久在线不卡| 国产精品88888| 久久久三级国产网站| 精品一区二区久久久| 日韩午夜电影av| 奇米亚洲午夜久久精品| 欧美日韩国产高清一区二区| 亚洲最色的网站| 色综合久久久久久久久| 亚洲人成网站色在线观看| 成人免费黄色大片| 欧美极品少妇xxxxⅹ高跟鞋 | 亚洲一区二区精品3399| 在线观看区一区二| 综合久久久久久| 99re这里都是精品| 亚洲三级理论片| 99视频精品在线| 国产精品久久久久久久久快鸭| 高潮精品一区videoshd| 亚洲在线观看免费视频| 欧美四级电影网| 亚洲永久精品国产| 欧美三级一区二区| 日韩电影在线一区二区三区| 欧美日韩国产乱码电影| 亚洲一区二区三区四区中文字幕| 欧美综合欧美视频| 丝袜美腿成人在线| 欧美大胆一级视频| 国精产品一区一区三区mba桃花 | 亚洲无人区一区| 欧美群妇大交群的观看方式| 三级亚洲高清视频| 精品欧美久久久| 国产乱码精品一区二区三区五月婷| 欧美第一区第二区| 国产大陆精品国产| 中文字幕在线一区二区三区| 99精品视频在线观看免费| 一区二区三区毛片| 日韩一级大片在线观看| 国产一区二区网址| 国产精品二三区| 欧美日韩性生活| 国产精一区二区三区| 国产精品久久久久久久第一福利 | 国产清纯白嫩初高生在线观看91 | 在线观看一区二区视频| 五月天亚洲婷婷| 久久精品夜色噜噜亚洲a∨| 成人免费看视频| 日韩精品国产欧美| 国产亚洲综合在线|