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

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

?? cwspcapabilities.java~2~

?? jwap 協議 udp 可以用于手機通訊
?? JAVA~2~
字號:
/** * JWAP - A Java Implementation of the WAP Protocols * Copyright (C) 2001-2004 Niko Bender * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */package net.sourceforge.jwap.wsp.pdu;import net.sourceforge.jwap.util.*;import java.util.*;/** * Capabilities allow the client to negotiate characteristics * and extended behaviours of the protocol (see section 8.3 of the WSP spec.). */public class CWSPCapabilities {    /**     * Table 37     */    public static final short TYPE_clientSDUSize = 0x00;    public static final short TYPE_serverSDUSize = 0x01;    public static final short TYPE_protocolOptions = 0x02;    public static final short TYPE_methodMOR = 0x03;    public static final short TYPE_pushMOR = 0x04;    public static final short TYPE_extendedMethods = 0x05;    public static final short TYPE_headerCodePages = 0x06;    public static final short TYPE_aliases = 0x07;    public static final short TYPE_clientMessageSize = 0x08;    public static final short TYPE_serverMessageSize = 0x09;    /**     * section 8.3.2.3     */    public static final short OPTION_CONF_PUSH_FACILITY = 0x80;    public static final short OPTION_PUSH_FACILITY = 0x40;    public static final short OPTION_SESSION_RESUME_FACILITY = 0x20;    public static final short OPTION_ACK_HEADERS = 0x10;    public static final short OPTION_LARGE_DATA_TRANSFER = 0x08;    /**     * section 8.3.2.1     * unintvar     */    private long clientSDUSize = 1400;    private boolean bClientSDUSize = false;    private long serverSDUSize = 1400;    private boolean bServerSDUSize = false;    /**     * section 8.3.2.3     * one octet     */    private long protocolOptions = 0x00;    private boolean bProtocolOptions = false;    /**     * section 8.3.2.4     * uint8     */    private long methodMOR = 1;    private boolean bMethodMOR = false;    private long pushMOR = 1;    private boolean bPushMOR = false;    /**     * section 8.3.2.5     * uint8     * multiple octets     */    private Hashtable extendedMethods = new Hashtable();    /**     * section 8.3.2.6     * uint8     * multiple octets     */    private Hashtable headerCodePages = new Hashtable();    /**     * section 8.3.2.7     * multiple octets     * encoded as redirect address in sec. 8.2.2.3     *     * BearerTypeIncluded, PortNumberIncluded, AddressLength     */    Vector aliases = new Vector();    /**     * section 8.3.2.2     * unintvar     */    private long clientMessageSize = 1024;    private boolean bClientMessageSize = false;    private long serverMessageSize = 1024;    private boolean bServerMessageSize = false;    /////////////////////////////////////////////////////////////////////////////    //////////////////////////////// GET/SET ////////////////////////////////////    public void setClientSDUSize(long clientSDUSize) {        this.clientSDUSize = clientSDUSize;        this.bClientSDUSize = true;    }    public long getClientSDUSize() {        return clientSDUSize;    }    public void setServerSDUSize(long serverSDUSize) {        this.serverSDUSize = serverSDUSize;        this.bServerSDUSize = true;    }    public long getServerSDUSize() {        return serverSDUSize;    }    /**     * set a protocoloption     * use constans in this class beginning with "OPTION_"     */    public void setProtocolOption(short option, boolean on_off) {        if (on_off) {            if (!getProtocolOption(option)) {                this.bProtocolOptions = true;                protocolOptions += option;            }        } else {            if (getProtocolOption(option)) {                protocolOptions -= option;            }        }    }    /**     * is the Option <code>option</code> set?     * use constants in this class beginnig with "OPTION_"     */    public boolean getProtocolOption(short option) {        BitSet s = BitArrayOutputStream.getBitSet(getProtocolOptions());        return s.get((int) (Math.log(option) / Math.log(2)));    }    public byte getProtocolOptions() {        BitArrayOutputStream m = new BitArrayOutputStream();        m.write(protocolOptions, 8);        byte[] b = m.toByteArray();        return b[0];    }    public void setMethodMOR(long methodMOR) {        this.methodMOR = methodMOR;        this.bMethodMOR = true;    }    public long getMethodMOR() {        return methodMOR;    }    public void setPushMOR(long pushMOR) {        this.pushMOR = pushMOR;        this.bPushMOR = true;    }    public long getPushMOR() {        return pushMOR;    }    public Hashtable getExtendedMethods() {        return extendedMethods;    }    public boolean addExtendedMethod(long pduType, String name) {        Long toAdd = new Long(pduType);        Enumeration keys = extendedMethods.keys();        while (keys.hasMoreElements()) {            Long akt = (Long) (keys.nextElement());            if (toAdd.equals(akt)) {                return false;            }        }        extendedMethods.put(new Long(pduType), name);        return true;    }    public boolean removeExtendedMethod(long pduType) {        Long search = new Long(pduType);        Enumeration keys = extendedMethods.keys();        while (keys.hasMoreElements()) {            Long akt = (Long) (keys.nextElement());            if (search.equals(akt)) {                extendedMethods.remove(akt);                return true;            }        }        return false;    }    public Hashtable getHeaderCodePages() {        return headerCodePages;    }    /**     * add a header code page     */    public boolean addHeaderCodePage(long pageCode, String name) {        Long toAdd = new Long(pageCode);        Enumeration keys = headerCodePages.keys();        while (keys.hasMoreElements()) {            Long akt = (Long) (keys.nextElement());            if (toAdd.equals(akt)) {                return false;            }        }        headerCodePages.put(toAdd, name);        return true;    }    /**     * remove a header code page if it exists.     */    public boolean removeHeaderCodePage(long pageCode) {        Long search = new Long(pageCode);        Enumeration keys = headerCodePages.keys();        while (keys.hasMoreElements()) {            Long akt = (Long) (keys.nextElement());            if (search.equals(akt)) {                headerCodePages.remove(akt);                return true;            }        }        return false;    }    public Vector getAliases() {        return aliases;    }    /**     * add a alias (alternate address of the sender)     */    public boolean addAlias(boolean bearerTypeIncluded,        boolean portNumberIncluded, short bearerType, int portNumber,        String bearerAddressToUse) {        CWSPAddress toAdd = new CWSPAddress(bearerTypeIncluded,                portNumberIncluded, bearerType, portNumber, bearerAddressToUse);        for (int i = 0; i < aliases.size(); i++) {            CWSPAddress search = (CWSPAddress) aliases.elementAt(i);            if (search.equals(toAdd)) {                return false;            }        }        aliases.add(toAdd);        return true;    }    /**     * remove a alias using the values as given     */    public boolean removeAlias(boolean bearerTypeIncluded,        boolean portNumberIncluded, short bearerType, int portNumber,        String bearerAddressToUse) {        CWSPAddress toRemove = new CWSPAddress(bearerTypeIncluded,                portNumberIncluded, bearerType, portNumber, bearerAddressToUse);        for (int i = 0; i < aliases.size(); i++) {            CWSPAddress search = (CWSPAddress) aliases.elementAt(i);            if (search.equals(toRemove)) {                aliases.remove(search);                return true;            }        }        return false;    }    public long getClientMessageSize() {        return clientMessageSize;    }    public void setClientMessageSize(long size) {        clientMessageSize = size;        this.bClientMessageSize = true;    }    public long getServerMessageSize() {        return serverMessageSize;    }    public void setServerMessageSize(long size) {        serverMessageSize = size;        this.bServerMessageSize = true;    }    /**     * encode all capabilities in a byte array     * according to WAP-230-WSP-20010705-a section 8.3 "capability encoding"     *     * @return The encoded bytes     */    public byte[] getBytes() {        BitArrayOutputStream result = new BitArrayOutputStream();        BitArrayOutputStream tmp = new BitArrayOutputStream();        byte[] tmp2;        if (this.bClientSDUSize) {            tmp.write(TYPE_clientSDUSize + 0x80, 8);            tmp.writeUintVar(clientSDUSize);            tmp2 = tmp.toByteArray();            result.writeUintVar(tmp2.length);            result.write(tmp2);        }        if (bServerSDUSize) {            tmp.reset();            tmp.write(TYPE_serverSDUSize + 0x80, 8);            tmp.writeUintVar(serverSDUSize);            tmp2 = tmp.toByteArray();            result.writeUintVar(tmp2.length);            result.write(tmp2);        }        if (bClientMessageSize) {            tmp.reset();            tmp.write(TYPE_clientMessageSize + 0x80, 8);            tmp.writeUintVar(clientMessageSize);            tmp2 = tmp.toByteArray();            result.writeUintVar(tmp2.length);            result.write(tmp2);        }        if (bServerMessageSize) {            tmp.reset();            tmp.write(TYPE_serverMessageSize + 0x80, 8);            tmp.writeUintVar(serverMessageSize);            tmp2 = tmp.toByteArray();            result.writeUintVar(tmp2.length);            result.write(tmp2);        }        if (bProtocolOptions) {            tmp.reset();            tmp.write(TYPE_protocolOptions + 0x80, 8);            tmp.write(protocolOptions, 8);            tmp2 = tmp.toByteArray();            result.writeUintVar(tmp2.length);            result.write(tmp2);        }        if (bMethodMOR) {            tmp.reset();            tmp.write(TYPE_methodMOR + 0x80, 8);            tmp.writeUintVar(methodMOR);            tmp2 = tmp.toByteArray();            result.writeUintVar(tmp2.length);            result.write(tmp2);        }        if (bPushMOR) {            tmp.reset();            tmp.write(TYPE_pushMOR + 0x80, 8);            tmp.writeUintVar(pushMOR);            tmp2 = tmp.toByteArray();            result.writeUintVar(tmp2.length);            result.write(tmp2);        }        if (!extendedMethods.isEmpty()) {            Enumeration keys = extendedMethods.keys();            while (keys.hasMoreElements()) {                tmp.reset();                Object key = keys.nextElement();                tmp.write(TYPE_extendedMethods + 0x80, 8);                tmp.write(((Long) key).longValue(), 8);                String value = (String) (extendedMethods.get(key));                tmp.write(value.getBytes());                tmp.write(0x00, 8);                tmp2 = tmp.toByteArray();                result.writeUintVar(tmp2.length);                result.write(tmp2);            }        }        if (!headerCodePages.isEmpty()) {            Enumeration keys = extendedMethods.keys();            while (keys.hasMoreElements()) {                tmp.reset();                Object key = keys.nextElement();                tmp.write(TYPE_headerCodePages + 0x80, 8);                tmp.write(((Long) key).longValue(), 8);                String value = (String) (extendedMethods.get(key));                tmp.write(value.getBytes());                tmp.write(0x00, 8);                tmp2 = tmp.toByteArray();                result.writeUintVar(tmp2.length);                result.write(tmp2);            }        }        if (!aliases.isEmpty()) {            for (int i = 0; i < aliases.size(); i++) {                tmp.reset();                CWSPAddress address = (CWSPAddress) aliases.elementAt(i);                tmp.write(TYPE_aliases + 0x80, 8);                tmp.write(address.getBytes());                tmp2 = tmp.toByteArray();                result.writeUintVar(tmp2.length);                result.write(tmp2);            }        }        return result.toByteArray();    }    /**     * Test method     *     * @param args ignored     */    public static void main(String[] args) {        CWSPCapabilities c = new CWSPCapabilities();        c.setProtocolOption(OPTION_PUSH_FACILITY, true);        c.setProtocolOption(OPTION_LARGE_DATA_TRANSFER, true);        byte b = c.getProtocolOptions();        System.out.println(BitArrayOutputStream.getBitString(b));    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美疯狂做受xxxx富婆| 精品国产一二三区| 欧美日韩国产另类一区| 精品视频123区在线观看| 制服丝袜av成人在线看| 日韩午夜在线影院| 欧美白人最猛性xxxxx69交| 久久丝袜美腿综合| 国产精品色眯眯| 午夜激情久久久| 另类小说色综合网站| www.欧美日韩国产在线| 欧美日韩在线免费视频| 久久婷婷国产综合国色天香| 亚洲精品美腿丝袜| 国产毛片精品一区| 欧美精品国产精品| 亚洲精品成人天堂一二三| 美女精品一区二区| 91国偷自产一区二区使用方法| 欧美日韩一区二区三区视频| 中文字幕精品一区| 久久激情五月激情| 精品视频一区三区九区| 国产精品天美传媒| 国产在线国偷精品产拍免费yy| 欧美少妇xxx| 亚洲一二三区在线观看| 91香蕉视频在线| 亚洲欧洲综合另类| 91理论电影在线观看| 国产精品青草久久| 一本久久a久久免费精品不卡| 久久综合九色综合欧美98| 日本成人在线不卡视频| 51午夜精品国产| 日本欧美一区二区三区| 精品国产凹凸成av人导航| 久久电影网电视剧免费观看| 欧美v国产在线一区二区三区| 日韩丝袜美女视频| 久久精品人人做| 国产精品第四页| 欧美无砖砖区免费| 亚洲一区二区三区四区在线 | 国产一区在线精品| 欧美韩国日本一区| 欧美无乱码久久久免费午夜一区| 亚洲电影在线播放| 国产精品色婷婷久久58| 欧美日韩亚洲另类| 成人深夜福利app| 日本美女视频一区二区| 欧美国产禁国产网站cc| 日本高清免费不卡视频| 激情成人综合网| 亚洲国产精品久久人人爱蜜臀 | 亚洲精品v日韩精品| 26uuu国产在线精品一区二区| 97久久精品人人爽人人爽蜜臀 | 91精品国产美女浴室洗澡无遮挡| 亚洲福利视频一区二区| 亚洲免费在线观看| 欧美国产日韩亚洲一区| 精品粉嫩aⅴ一区二区三区四区| 91在线播放网址| 大桥未久av一区二区三区中文| 麻豆精品一区二区av白丝在线| 亚洲美女区一区| 亚洲精品视频在线观看免费| 中文字幕视频一区| 欧美极品美女视频| 亚洲色图.com| 亚洲精品视频在线看| 一区二区三区免费看视频| 亚洲男人天堂av网| 亚洲欧美日韩成人高清在线一区| 亚洲国产成人午夜在线一区| 国产精品久久久久三级| 亚洲欧洲成人精品av97| 亚洲精品一卡二卡| 亚洲一区二区视频| 久久国产免费看| 精品无人区卡一卡二卡三乱码免费卡 | 欧美视频日韩视频| 欧美一区二区三区免费| 国产欧美日韩综合精品一区二区| 久久久一区二区| 国产精品激情偷乱一区二区∴| 国产精品污www在线观看| 一区二区三区电影在线播| 喷白浆一区二区| 色综合久久久久久久久久久| 欧美疯狂性受xxxxx喷水图片| 国产欧美一区视频| 日本aⅴ亚洲精品中文乱码| 国产91精品一区二区麻豆网站| 色噜噜偷拍精品综合在线| 久久综合九色综合97婷婷| 亚洲自拍偷拍九九九| 国产精品一区二区在线看| 91精品久久久久久久久99蜜臂| 国产精品久久久久aaaa樱花 | 丝袜亚洲另类欧美综合| 91在线国产福利| 国产精品欧美综合在线| 国产在线精品免费av| 欧美岛国在线观看| 看国产成人h片视频| 91精品国产高清一区二区三区蜜臀 | 色婷婷av一区二区三区软件| 18成人在线观看| 97se亚洲国产综合在线| 亚洲福利视频三区| 91精品国产aⅴ一区二区| 日韩高清电影一区| 久久综合色8888| 99视频一区二区三区| 亚洲一区二区免费视频| 日韩欧美国产精品一区| 蜜桃在线一区二区三区| 国产肉丝袜一区二区| 91丨九色丨黑人外教| 亚洲高清免费一级二级三级| 欧美一级爆毛片| 成人动漫一区二区在线| 亚洲国产精品综合小说图片区| 亚洲精品在线观| 欧美日韩三级一区| 成人av网在线| 午夜久久久影院| 国产亚洲欧美色| 欧美一区二区视频观看视频| 国产激情一区二区三区桃花岛亚洲| 国产精品美女久久久久久久久| 欧美影视一区在线| 91视频免费看| www.欧美色图| 成人免费黄色在线| 国产尤物一区二区| 毛片不卡一区二区| 日本视频在线一区| 视频一区欧美日韩| 天天色综合成人网| 午夜精品久久久久久久99水蜜桃 | 91激情在线视频| 欧美手机在线视频| 色婷婷综合久久久中文一区二区| 成人免费看片app下载| av资源网一区| 99久久综合狠狠综合久久| 成人av一区二区三区| 99国产精品久久久久久久久久久| 丰满少妇在线播放bd日韩电影| 国产成人综合在线播放| 91视频91自| 欧美精品一级二级| 久久久久88色偷偷免费| 国产精品色哟哟网站| 亚洲成人tv网| 国产麻豆精品视频| 色综合网站在线| 51精品久久久久久久蜜臀| 久久夜色精品国产欧美乱极品| 亚洲国产激情av| 亚洲一级电影视频| 风间由美一区二区三区在线观看 | 美脚の诱脚舐め脚责91 | 欧美亚洲尤物久久| 久久品道一品道久久精品| 玉米视频成人免费看| 国产风韵犹存在线视精品| 在线观看国产精品网站| 日韩你懂的在线播放| 亚洲一区电影777| 91亚洲午夜精品久久久久久| 91精品国产手机| 亚洲成av人影院| 99这里只有精品| 国产精品久久久久久久岛一牛影视 | 国产女同互慰高潮91漫画| 亚洲欧美国产毛片在线| 精品在线你懂的| 日韩丝袜美女视频| 亚洲一区二区精品3399| 91福利视频久久久久| 中文字幕一区二区三区av| 国产精品一级片| 亚洲国产高清在线| 国产精品一区二区黑丝| 日韩一级片在线播放| 日韩va欧美va亚洲va久久| 欧美日韩高清不卡| 麻豆一区二区三| 久久天天做天天爱综合色| 成人高清伦理免费影院在线观看| 国产精品色哟哟| 欧美二区三区的天堂| 国产一区二区在线观看免费 | 国产九九视频一区二区三区|