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

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

?? wbxmldecoder.java~5~

?? jwap 協議 udp 可以用于手機通訊
?? JAVA~5~
?? 第 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一区二区三区免费野_久草精品视频
国产日韩高清在线| 欧美日韩一本到| 亚洲伊人伊色伊影伊综合网| 日韩一区二区视频| 99精品桃花视频在线观看| 天堂一区二区在线免费观看| 国产亚洲一区二区三区在线观看| 色婷婷一区二区三区四区| 狠狠久久亚洲欧美| 天天综合色天天综合色h| 亚洲欧美综合色| 精品少妇一区二区三区视频免付费| 91麻豆免费看片| 国产福利一区二区三区视频在线| 亚洲国产成人高清精品| 亚洲日本成人在线观看| 欧美国产欧美综合| 欧美成人乱码一区二区三区| 欧美日本韩国一区二区三区视频| 91原创在线视频| 国产91精品露脸国语对白| 久久精品国产精品亚洲红杏| 日韩在线一二三区| 亚洲第一成人在线| 亚洲国产欧美在线| 一区二区欧美视频| 亚洲美女视频在线| 亚洲婷婷国产精品电影人久久| 国产欧美精品日韩区二区麻豆天美| 日韩亚洲欧美一区| 欧美一区永久视频免费观看| 欧美久久久久久久久中文字幕| 日本久久电影网| 色先锋资源久久综合| 99久久国产综合精品色伊| 大胆欧美人体老妇| 成人污视频在线观看| 成人高清视频免费观看| 高清在线不卡av| 成人av免费网站| 99久久精品一区二区| 91在线观看免费视频| 91免费观看国产| 色婷婷精品大在线视频| 91成人在线精品| 欧美精品第1页| 日韩一区二区三区av| 欧美zozozo| 久久久久久影视| 国产精品蜜臀av| 亚洲色图清纯唯美| 亚洲国产视频在线| 蜜桃久久av一区| 国产一区二区女| bt7086福利一区国产| 在线视频你懂得一区| 欧美精品久久久久久久久老牛影院| 欧美高清你懂得| 26uuu久久天堂性欧美| 国产精品久线在线观看| 玉足女爽爽91| 亚洲无人区一区| 久久69国产一区二区蜜臀| 国产大片一区二区| 在线亚洲免费视频| 欧美一级在线观看| 国产亚洲欧美色| 亚洲欧美日韩国产综合在线| 亚洲成a人片在线观看中文| 日本特黄久久久高潮| 国产999精品久久久久久绿帽| 91麻豆国产福利精品| 欧美精品日韩一区| 久久久99精品久久| 亚洲激情av在线| 国内久久精品视频| 一本久久a久久免费精品不卡| 91精品午夜视频| 中文字幕av资源一区| 亚洲成av人片观看| 国产福利一区二区三区视频| 欧洲av一区二区嗯嗯嗯啊| 精品久久久久久久久久久久包黑料 | 精品国产制服丝袜高跟| 国产精品色婷婷| 亚洲成人av在线电影| 国产成人av一区二区三区在线 | 欧美理论电影在线| 国产亚洲一本大道中文在线| 亚洲成人三级小说| 成人免费看的视频| 日韩一区二区三区视频在线| 亚洲久草在线视频| 国产一级精品在线| 欧美片在线播放| 91九色最新地址| 亚洲一区视频在线| 国产精品一卡二| 欧美性色aⅴ视频一区日韩精品| 精品久久久久久久一区二区蜜臀| 一区二区三区日韩精品| 狠狠色狠狠色合久久伊人| 在线免费精品视频| 中文字幕成人av| 久久国产夜色精品鲁鲁99| 在线精品视频小说1| 国产免费成人在线视频| 美女一区二区三区| 欧美欧美午夜aⅴ在线观看| 国产精品久久毛片a| 狠狠色丁香久久婷婷综合_中| 欧美性大战久久久久久久| 国产精品久久久久久久久免费丝袜 | 日韩激情av在线| 不卡视频在线观看| 久久婷婷久久一区二区三区| 亚洲影视在线观看| 99riav一区二区三区| 久久你懂得1024| 日韩精品免费专区| 欧美性大战xxxxx久久久| 亚洲私人影院在线观看| 高清不卡一二三区| 久久久久亚洲综合| 国产一区二区三区| 欧美精品一区二区久久久| 日韩在线观看一区二区| 欧美日韩一级视频| 亚洲一区av在线| 在线观看国产日韩| 亚洲精品你懂的| 91成人在线免费观看| 一区二区不卡在线视频 午夜欧美不卡在 | 亚洲一区二区成人在线观看| 97久久精品人人爽人人爽蜜臀| 国产精品视频九色porn| 成人免费看片app下载| 国产精品久久久久久久久果冻传媒| 国产一区久久久| 欧美激情一区不卡| 国产精品小仙女| 日本一区二区在线不卡| 国产一区二区三区电影在线观看| 久久久久久久久蜜桃| 国产成人在线网站| 国产精品欧美综合在线| av电影在线观看一区| 亚洲视频每日更新| 欧美天堂一区二区三区| 亚洲成人久久影院| 3atv在线一区二区三区| 老司机精品视频在线| 国产色产综合产在线视频| 风间由美一区二区av101| 日韩理论在线观看| 欧美日韩精品一区二区| 激情图区综合网| 国产精品网曝门| 欧美午夜免费电影| 美女视频一区二区| 中文字幕电影一区| 欧美亚洲自拍偷拍| 久久精品国产999大香线蕉| 久久久99精品久久| 色网站国产精品| 免费看日韩精品| 国产精品三级av在线播放| 91亚洲大成网污www| 日韩av在线发布| 国产视频视频一区| 欧美乱熟臀69xxxxxx| 国产成人免费xxxxxxxx| 亚洲一区二区三区四区中文字幕| 欧美一区二区三区视频在线观看| 国产美女主播视频一区| 一区二区免费在线播放| 欧美一区二区三区在线视频| 国产盗摄视频一区二区三区| 亚洲香蕉伊在人在线观| 国产色综合一区| 奇米影视一区二区三区| 日本不卡视频在线观看| 精品久久久久久综合日本欧美 | 欧美性受xxxx黑人xyx| 青娱乐精品视频在线| 国产欧美中文在线| 欧美性色aⅴ视频一区日韩精品| 国产一区二区电影| 亚洲一区二区不卡免费| 日本一区二区免费在线观看视频 | 99精品视频一区| 男男gaygay亚洲| 亚洲人成人一区二区在线观看| 正在播放亚洲一区| 99re在线精品| 国产宾馆实践打屁股91| 蜜臀av性久久久久蜜臀av麻豆| ...xxx性欧美| 久久久久国产一区二区三区四区| 欧美精品18+|