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

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

?? wbxmlserializer.java

?? < JavaME核心技術最佳實踐>>的全部源代碼
?? JAVA
字號:
/* Copyright (c) 2002,2003, Stefan Haustein, Oberhausen, Rhld., Germany * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The  above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */package org.kxml2.wap;import java.io.*;import java.util.*;import org.xmlpull.v1.*;// TODO: make some of the "direct" WBXML token writing methods public??/**  * A class for writing WBXML.  *   */public class WbxmlSerializer implements XmlSerializer {    Hashtable stringTable = new Hashtable();    OutputStream out;    ByteArrayOutputStream buf = new ByteArrayOutputStream();    ByteArrayOutputStream stringTableBuf = new ByteArrayOutputStream();    String pending;    int depth;    String name;    String namespace;    Vector attributes = new Vector();    Hashtable attrStartTable = new Hashtable();    Hashtable attrValueTable = new Hashtable();    Hashtable tagTable = new Hashtable();	private int attrPage;	private int tagPage;    public XmlSerializer attribute(String namespace, String name, String value) {        attributes.addElement(name);        attributes.addElement(value);        return this;    }    public void cdsect (String cdsect) throws IOException{        text (cdsect);    }    /* silently ignore comment */    public void comment (String comment) {    }        public void docdecl (String docdecl) {        throw new RuntimeException ("Cannot write docdecl for WBXML");    }    public void entityRef (String er) {        throw new RuntimeException ("EntityReference not supported for WBXML");    }        public int getDepth() {    	return depth;    }    public boolean getFeature (String name) {        return false;    }    	public String getNamespace() {		throw new RuntimeException("NYI");	}		public String getName() {		throw new RuntimeException("NYI");	}		public String getPrefix(String nsp, boolean create) {        throw new RuntimeException ("NYI");    }            public Object getProperty (String name) {        return null;    }    public void ignorableWhitespace (String sp) {    }        public void endDocument() throws IOException {        writeInt(out, stringTableBuf.size());        // write StringTable        out.write(stringTableBuf.toByteArray());        // write buf         out.write(buf.toByteArray());        // ready!        out.flush();    }    /** ATTENTION: flush cannot work since Wbxml documents require    need buffering. Thus, this call does nothing. */    public void flush() {    }    public void checkPending(boolean degenerated) throws IOException {        if (pending == null)            return;        int len = attributes.size();        int[] idx = (int[]) tagTable.get(pending);        // if no entry in known table, then add as literal        if (idx == null) {            buf.write(                len == 0                    ? (degenerated ? Wbxml.LITERAL : Wbxml.LITERAL_C)                    : (degenerated ? Wbxml.LITERAL_A : Wbxml.LITERAL_AC));            writeStrT(pending);        }        else {        	if(idx[0] != tagPage){        		tagPage=idx[0];        		buf.write(0);        		buf.write(tagPage);        	}        	            buf.write(                len == 0                    ? (degenerated ? idx[1] : idx[1] | 64)                    : (degenerated                        ? idx[1] | 128                        : idx[1] | 192));        }        for (int i = 0; i < len;) {            idx = (int[]) attrStartTable.get(attributes.elementAt(i));                        if (idx == null) {                buf.write(Wbxml.LITERAL);                writeStrT((String) attributes.elementAt(i));            }            else {				if(idx[0] != attrPage){					attrPage = idx[1];					buf.write(0);					buf.write(attrPage);									}                buf.write(idx[1]);            }            idx = (int[]) attrValueTable.get(attributes.elementAt(++i));            if (idx == null) {                buf.write(Wbxml.STR_I);                writeStrI(buf, (String) attributes.elementAt(i));            }            else {				if(idx[0] != attrPage){					attrPage = idx[1];					buf.write(0);					buf.write(attrPage);									}                buf.write(idx[1]);            }            ++i;        }        if (len > 0)            buf.write(Wbxml.END);        pending = null;        attributes.removeAllElements();    }    public void processingInstruction(String pi) {        throw new RuntimeException ("PI NYI");    }    public void setFeature(String name, boolean value) {        throw new IllegalArgumentException ("unknown feature "+name);    }            public void setOutput (Writer writer) {        throw new RuntimeException ("Wbxml requires an OutputStream!");    }    public void setOutput (OutputStream out, String encoding) throws IOException {                if (encoding != null) throw new IllegalArgumentException ("encoding not yet supported for WBXML");                this.out = out;        buf = new ByteArrayOutputStream();        stringTableBuf = new ByteArrayOutputStream();        // ok, write header     }    public void setPrefix(String prefix, String nsp) {        throw new RuntimeException("NYI");    }    public void setProperty(String property, Object value) {        throw new IllegalArgumentException ("unknown property "+property);    }        public void startDocument(String s, Boolean b) throws IOException{        out.write(0x01); // version        out.write(0x01); // unknown or missing public identifier        out.write(0x04); // iso-8859-1    }    public XmlSerializer startTag(String namespace, String name) throws IOException {        if (namespace != null && !"".equals(namespace))             throw new RuntimeException ("NSP NYI");        //current = new State(current, prefixMap, name);        checkPending(false);        pending = name;		depth++;		        return this;    }    public XmlSerializer text(char[] chars, int start, int len) throws IOException {        checkPending(false);        buf.write(Wbxml.STR_I);        writeStrI(buf, new String(chars, start, len));        return this;    }    public XmlSerializer text(String text) throws IOException {        checkPending(false);        buf.write(Wbxml.STR_I);        writeStrI(buf, text);        return this;    }            public XmlSerializer endTag(String namespace, String name) throws IOException {//        current = current.prev;        if (pending != null)            checkPending(true);        else            buf.write(Wbxml.END);		depth--;        return this;    }    /** currently ignored! */    public void writeLegacy(int type, String data) {    }    // ------------- internal methods --------------------------    static void writeInt(OutputStream out, int i) throws IOException {        byte[] buf = new byte[5];        int idx = 0;        do {            buf[idx++] = (byte) (i & 0x7f);            i = i >> 7;        }        while (i != 0);        while (idx > 1) {            out.write(buf[--idx] | 0x80);        }        out.write(buf[0]);    }    static void writeStrI(OutputStream out, String s) throws IOException {        for (int i = 0; i < s.length(); i++) {            out.write((byte) s.charAt(i));        }        out.write(0);    }    void writeStrT(String s) throws IOException {        Integer idx = (Integer) stringTable.get(s);        if (idx == null) {            idx = new Integer(stringTableBuf.size());            stringTable.put(s, idx);            writeStrI(stringTableBuf, s);            stringTableBuf.flush();        }        writeInt(buf, idx.intValue());    }    /**      * Sets the tag table for a given page.     * The first string in the array defines tag 5, the second tag 6 etc.     */        public void setTagTable(int page, String[] tagTable) {        // clear entries in tagTable!		if (page != 0)			return;        for (int i = 0; i < tagTable.length; i++) {            if (tagTable[i] != null) {                Object idx = new int[]{page, i+5};                this.tagTable.put(tagTable[i], idx);            }        }    }    /**      * Sets the attribute start Table for a given page.     * The first string in the array defines attribute      * 5, the second attribute 6 etc.     *  Please use the      *  character '=' (without quote!) as delimiter      *  between the attribute name and the (start of the) value      */    public void setAttrStartTable(int page, String[] attrStartTable) {                for (int i = 0; i < attrStartTable.length; i++) {            if (attrStartTable[i] != null) {                Object idx = new int[] {page, i + 5};                this.attrStartTable.put(attrStartTable[i], idx);            }        }    }    /**      * Sets the attribute value Table for a given page.     * The first string in the array defines attribute value 0x85,      * the second attribute value 0x86 etc.     */    public void setAttrValueTable(int page, String[] attrValueTable) {        // clear entries in this.table!        for (int i = 0; i < attrValueTable.length; i++) {            if (attrValueTable[i] != null) {                Object idx = new int[]{page, i + 0x085};                this.attrValueTable.put(attrValueTable[i], idx);            }        }    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区在线高清| 蜜臂av日日欢夜夜爽一区| 欧美片网站yy| 高清不卡在线观看| 日本在线播放一区二区三区| 国产精品女主播av| 久久伊人中文字幕| 5月丁香婷婷综合| 99精品国产一区二区三区不卡| 日本不卡的三区四区五区| 亚洲日本一区二区| 国产午夜精品久久久久久久| 欧美精品丝袜中出| 色香色香欲天天天影视综合网| 国产一区二区在线免费观看| 日本不卡免费在线视频| 亚洲一二三区视频在线观看| 中文字幕在线观看不卡| 久久久美女毛片| 日韩欧美高清一区| 欧美精品 国产精品| 色菇凉天天综合网| 一本大道综合伊人精品热热| 成人手机电影网| 国产成人在线网站| 国产剧情在线观看一区二区| 麻豆免费看一区二区三区| 亚洲一区二区三区影院| 亚洲综合成人在线视频| 亚洲男女一区二区三区| 亚洲品质自拍视频| 亚洲少妇中出一区| 最新国产の精品合集bt伙计| 国产精品女主播av| 中文字幕一区二区三区在线不卡| 久久久久国产成人精品亚洲午夜| 日韩天堂在线观看| 日韩精品一区二区三区在线观看| 欧美成人vps| 久久先锋影音av鲁色资源| 欧美精品一区二区三区在线| 久久亚洲一区二区三区四区| 精品成人在线观看| 国产色一区二区| 国产精品嫩草影院av蜜臀| 国产精品美女久久久久av爽李琼| 欧美激情中文字幕| 亚洲欧美一区二区三区久本道91| 亚洲男人的天堂网| 天天av天天翘天天综合网 | 99久久精品国产观看| 99久久国产综合精品色伊| 97精品国产露脸对白| 色乱码一区二区三区88| 欧美日韩精品一区二区三区| 4438成人网| 欧美草草影院在线视频| wwwwww.欧美系列| 国产欧美精品一区二区色综合朱莉| 亚洲国产成人私人影院tom| 国产精品久久久久久久久果冻传媒 | 欧洲精品中文字幕| 欧美三电影在线| 精品国产免费一区二区三区香蕉| 国产亚洲1区2区3区| 亚洲色图视频网| 午夜成人免费视频| 国产九九视频一区二区三区| 91在线一区二区| 91麻豆精品国产91久久久资源速度| 欧美成人伊人久久综合网| 国产日韩欧美麻豆| 亚洲一区视频在线观看视频| 久久疯狂做爰流白浆xx| 97精品久久久午夜一区二区三区| 欧美精品久久99久久在免费线| 久久蜜桃香蕉精品一区二区三区| 中文字幕永久在线不卡| 性做久久久久久免费观看 | 奇米888四色在线精品| 国产成人在线观看| 欧美电影一区二区| 国产无遮挡一区二区三区毛片日本 | 国产午夜精品一区二区三区视频 | 国产成人精品一区二区三区四区| 99久久精品情趣| 欧美一区二区人人喊爽| 成人欧美一区二区三区视频网页| 日日噜噜夜夜狠狠视频欧美人| 国产精品一区二区你懂的| 欧美日韩精品二区第二页| 欧美国产一区二区| 日本不卡高清视频| 日本高清免费不卡视频| 久久女同性恋中文字幕| 亚洲国产裸拍裸体视频在线观看乱了| 精品在线你懂的| 欧美日韩激情在线| 亚洲欧洲日本在线| 极品少妇xxxx精品少妇偷拍| 欧美手机在线视频| 亚洲欧美自拍偷拍| 国产一区福利在线| 日韩欧美一区二区在线视频| 亚洲精品久久久蜜桃| 国产91露脸合集magnet| 91精品国产入口| 亚洲福利一二三区| 91麻豆精品视频| 国产精品色一区二区三区| 国产在线播放一区二区三区| 欧美性色欧美a在线播放| 成人免费一区二区三区在线观看 | 91在线精品一区二区| 欧美成人乱码一区二区三区| 天天综合天天综合色| 欧美亚洲禁片免费| 亚洲丝袜精品丝袜在线| 成人激情免费电影网址| 国产亚洲精品7777| 国产精品亚洲综合一区在线观看| 日韩欧美在线一区二区三区| 视频在线观看91| 欧美蜜桃一区二区三区| 亚洲午夜激情av| 欧洲av在线精品| 中文字幕一区三区| 成人一二三区视频| 国产午夜亚洲精品理论片色戒| 国产一区二区中文字幕| 久久久噜噜噜久噜久久综合| 日韩成人免费电影| 欧美久久免费观看| 偷窥少妇高潮呻吟av久久免费| 色婷婷一区二区三区四区| 中文字幕亚洲精品在线观看| 99视频一区二区| 亚洲欧美电影院| 欧美三级视频在线| 日韩精品欧美精品| 精品奇米国产一区二区三区| 麻豆精品国产91久久久久久| 欧美一级高清片在线观看| 三级精品在线观看| 精品国产麻豆免费人成网站| 狠狠色丁香久久婷婷综合_中 | 日韩一级视频免费观看在线| 日韩高清不卡一区二区| 日韩三级电影网址| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 久久精工是国产品牌吗| 日韩亚洲欧美高清| 国产综合一区二区| 亚洲欧洲性图库| 欧美亚洲日本一区| 日韩激情视频在线观看| 精品国产区一区| 99re视频精品| 亚州成人在线电影| 久久亚洲二区三区| 色综合亚洲欧洲| 免费观看一级特黄欧美大片| 久久久久久麻豆| 色欧美日韩亚洲| 麻豆中文一区二区| 国产精品久久久久久久久久久免费看| 色狠狠色狠狠综合| 精品制服美女久久| 亚洲欧美另类图片小说| 正在播放亚洲一区| 成人午夜又粗又硬又大| 亚洲国产美国国产综合一区二区| 欧美tickling网站挠脚心| 99久久精品免费看| 麻豆精品在线播放| 亚洲精品久久嫩草网站秘色| 91精品国产91热久久久做人人| 国产高清精品久久久久| 亚洲午夜av在线| 国产欧美日韩久久| 制服丝袜亚洲色图| 9l国产精品久久久久麻豆| 五月天中文字幕一区二区| 国产偷国产偷亚洲高清人白洁| 欧美在线视频日韩| 国产69精品久久久久毛片| 亚洲国产一区二区三区青草影视| 久久亚洲精精品中文字幕早川悠里| 欧美制服丝袜第一页| 国产激情偷乱视频一区二区三区| 一区二区三区精品| 国产日韩欧美激情| 欧美一级生活片| 色成人在线视频| 成人综合在线观看| 激情都市一区二区| 日韩电影在线一区二区三区| 中文字幕亚洲精品在线观看| 久久婷婷一区二区三区| 在线成人高清不卡|