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

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

?? asnoctets.java

?? 無線網絡管理
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
// NAME//      $RCSfile: AsnOctets.java,v $// DESCRIPTION//      [given below in javadoc format]// DELTA//      $Revision: 3.39 $// CREATED//      $Date: 2006/03/23 14:54:10 $// COPYRIGHT//      Westhawk Ltd// TO DO///* * Copyright (C) 1995, 1996 by West Consulting BV * * Permission to use, copy, modify, and distribute this software * for any purpose and without fee is hereby granted, provided * that the above copyright notices appear in all copies and that * both the copyright notice and this permission notice appear in * supporting documentation. * This software is provided "as is" without express or implied * warranty. * author <a href="mailto:snmp@westhawk.co.uk">Tim Panton</a> * original version by hargrave@dellgate.us.dell.com (Jordan Hargrave) *//* * Copyright (C) 1996 - 2006 by Westhawk Ltd * <a href="www.westhawk.co.uk">www.westhawk.co.uk</a> * * Permission to use, copy, modify, and distribute this software * for any purpose and without fee is hereby granted, provided * that the above copyright notices appear in all copies and that * both the copyright notice and this permission notice appear in * supporting documentation. * This software is provided "as is" without express or implied * warranty. * author <a href="mailto:snmp@westhawk.co.uk">Tim Panton</a> */package uk.co.westhawk.snmp.stack;import uk.co.westhawk.snmp.util.*;import java.io.*;import java.util.*;import java.net.InetAddress;import java.text.SimpleDateFormat;/** * This class represents the ASN.1 Octet class. * It can be used for Octets, Ip Addresses and Opaque primitive types.  * * The Octets type (ASN_OCTET_STR) is used for some text convensions.  * This class supports the DateAndTime, DisplayString and * InternationalDisplayString and Ipv6Address text convensions.  * <br/> * Note, the SNMP representation of IPv4 and IPv6 is different: * <ul> *    <li>IPv4: IPADDRESS (or ASN_OCTET_STR, see rfc 4001)</li> *    <li>IPv6: ASN_OCTET_STR</li> * </ul> * See also  * <a href="http://www.ietf.org/rfc/rfc2465.txt">IPV6-TC</a>, * <a href="http://www.ietf.org/rfc/rfc3416.txt">SNMPv2-PDU</a>, * <a href="http://www.ietf.org/rfc/rfc4001.txt">INET-ADDRESS-MIB</a>. * * @see SnmpConstants#ASN_OCTET_STR * @see SnmpConstants#IPADDRESS * @see SnmpConstants#OPAQUE * * @author <a href="mailto:snmp@westhawk.co.uk">Tim Panton</a> * @version $Revision: 3.39 $ $Date: 2006/03/23 14:54:10 $ */public class AsnOctets extends AsnObject{    private static final String     version_id =        "@(#)$Id: AsnOctets.java,v 3.39 2006/03/23 14:54:10 birgit Exp $ Copyright Westhawk Ltd";    /**     * The hexadecimal prefix that is used when printing a hexadecimal     * number in toString(). By default this is "0x".     */    public static String HEX_PREFIX = "0x";    /**     * The object that is used in toCalendar() to format the calendar      * representation of the Octets according to the DateAndTime text      * convension.     * The pattern is "yyyy-M-d,HH:mm:ss.SS,z".     *     * @see #getCalendar()     * @see #toCalendar()     * @see java.text.SimpleDateFormat      */    public static SimpleDateFormat CALFORMAT = new SimpleDateFormat("yyyy-M-d,HH:mm:ss.SS,z");    /**     * The default AsnOctetsPrintableFace object.     *     * @see #setPrintable     * @see DefaultAsnOctetsPrintable     */    public static AsnOctetsPrintableFace printableObject = new DefaultAsnOctetsPrintable();    byte value[];    /** Cache the hash code for the OID */    private int hash = 0;    /**      * Constructor. The type of the AsnOctets defaults to ASN_OCTET_STR.     *     * @param s The byte array representing the AsnOctets     * @see SnmpConstants#ASN_OCTET_STR      */    public AsnOctets(byte s[])     throws IllegalArgumentException    {        this(s, ASN_OCTET_STR);    }    /**      * Constructor to create a specific type of AsnOctets.     *     * @param s The byte array representing the AsnOctets     * @param t The type of the AsnOctets     * @see SnmpConstants#ASN_OCTET_STR      * @see SnmpConstants#IPADDRESS     * @see SnmpConstants#OPAQUE     */    public AsnOctets(byte s[], byte t)     throws IllegalArgumentException    {        value = s;        type = t;        if (value == null)        {            throw new IllegalArgumentException("Value is null");        }    }    /**      * Constructor. The type of the AsnOctets defaults to ASN_OCTET_STR.     *     * @param s The character array representing the AsnOctets     * @see SnmpConstants#ASN_OCTET_STR      */    public AsnOctets(char s[])     {        int idx;                value = new byte[s.length];        type = ASN_OCTET_STR;        for (idx=0; idx<s.length; idx++)         {            value[idx] = (byte)s[idx];        }    }    /**      * Constructor. The type of the AsnOctets defaults to ASN_OCTET_STR.     *     * @param s The string representing the AsnOctets     * @see SnmpConstants#ASN_OCTET_STR      */    public AsnOctets(String s)     {        this(s.toCharArray());    }    /**      * Constructor to create an ASN IP Address.      * If the address represents an IPv4 address, the asn type will be     * set to IPADDRESS. If it represents an IPv6 address, the asn type     * will be set to ASN_OCTET_STR.     *     * <br/>     * Note, the SNMP representation of IPv4 and IPv6 is different:     * <ul>     *    <li>IPv4: IPADDRESS (or ASN_OCTET_STR, see rfc 4001)</li>     *    <li>IPv6: ASN_OCTET_STR</li>     * </ul>     * See also      * <a href="http://www.ietf.org/rfc/rfc2465.txt">IPV6-TC</a>,     * <a href="http://www.ietf.org/rfc/rfc3416.txt">SNMPv2-PDU</a>,     * <a href="http://www.ietf.org/rfc/rfc4001.txt">INET-ADDRESS-MIB</a>.     *     * @param iad The Inet Address      *     * @see #AsnOctets(Inet4Address, byte)     */    public AsnOctets(java.net.InetAddress iad)    throws IllegalArgumentException    {        this(iad.getAddress(), ASN_OCTET_STR);        if (iad instanceof java.net.Inet4Address)        {            // IPv4            type = IPADDRESS;        }        else        {            // IPv6 is ASN_OCTET_STR, so do nothing        }    }    /**      * Constructor to create an ASN IPv4 Address.      * If the address is an IPv4 address, it can either be represented     * by IPADDRESS or as ASN_OCTET_STR.     *     * See also      * <a href="http://www.ietf.org/rfc/rfc2465.txt">IPV6-TC</a>,     * <a href="http://www.ietf.org/rfc/rfc3416.txt">SNMPv2-PDU</a>,     * <a href="http://www.ietf.org/rfc/rfc4001.txt">INET-ADDRESS-MIB</a>.     *     * @param iad The IPv4 Inet Address      * @param t The type of the AsnOctets      *     * @see #AsnOctets(InetAddress)     * @see SnmpConstants#IPADDRESS     * @see SnmpConstants#ASN_OCTET_STR     * @since 4_14     */    public AsnOctets(java.net.Inet4Address iad, byte t)    throws IllegalArgumentException    {        this(iad.getAddress(), t);    }    /**     * Constructor for DateAndTime text convension.     * See      * <a href="http://www.ietf.org/rfc/rfc2579.txt">SNMPv2-TC</a>     *     * <pre>     *      field  octets  contents                  range     *      -----  ------  --------                  -----     *        1      1-2   year*                     0..65536     *        2       3    month                     1..12     *        3       4    day                       1..31     *        4       5    hour                      0..23     *        5       6    minutes                   0..59     *        6       7    seconds                   0..60     *                     (use 60 for leap-second)     *        7       8    deci-seconds              0..9     *     *        8       9    direction from UTC        '+' / '-'     *        9      10    hours from UTC*           0..13     *       10      11    minutes from UTC          0..59     *     * SYNTAX       OCTET STRING (SIZE (8 | 11))     * </pre>     *     * @since 4_14     */    public AsnOctets(java.util.Calendar cal)    {        value = new byte[11];        type = ASN_OCTET_STR;                int year = cal.get(Calendar.YEAR);        // Calendar: 0=January        int month = cal.get(Calendar.MONTH)+1;        int day = cal.get(Calendar.DAY_OF_MONTH);        int hour = cal.get(Calendar.HOUR_OF_DAY);        int min = cal.get(Calendar.MINUTE);        int sec = cal.get(Calendar.SECOND);        int msec = cal.get(Calendar.MILLISECOND);        int msecGMT = cal.get(Calendar.ZONE_OFFSET);        // The value of year is in network-byte order        // Is this correct?        value[0] = (byte) ((year / 256) % 256);        value[1] = (byte) (year % 256);        value[2] = (byte) (month & 0xFF);        value[3] = (byte) (day & 0xFF);        value[4] = (byte) (hour & 0xFF);        value[5] = (byte) (min & 0xFF);        value[6] = (byte) (sec & 0xFF);        value[7] = (byte) ((msec / 100) & 0xFF);        char dir = '\0';        if (msecGMT < 0)        {            dir = '-';            msecGMT = msecGMT * -1;        }        else        {            dir = '+';        }        value[8] = (byte) dir;        if (msecGMT == 0)        {            value[9] = 0x00;            value[10] = 0x00;        }        else        {            int minGMT = (int) (((double) msecGMT) / 1000.0 / 60.0);            if (minGMT == 0)            {                value[9] = 0x00;                value[10] = 0x00;            }            else            {                int hourGMT = (int) (minGMT / 60.0);                minGMT = minGMT - (hourGMT * 60);                value[9] = (byte) (hourGMT & 0xFF);                value[10] = (byte) (minGMT & 0xFF);            }        }    }    /**      * Constructor.     *     * @param in The input stream from which the value should be read     * @param len The length of the AsnOctets     */    public AsnOctets(InputStream in, int len) throws IOException     {        value = new byte[len];        if (len != 0)        {            if (len == in.read(value,0,len))            {                String str = "";                //str = new String(value);            }            else             {                throw new IOException("AsnOctets(): Not enough data");            }        }        else        {            // if len is zero, the in.read will return -1            // a length of zero is a valid case.            ;        }    }    /**     * Sets the global hexadecimal prefix. This prefix will be used in     * toString() when it prints out a hexadecimal number. It is not     * used in toHex(). The default is "0x".     *     * @see #toString()     * @see #toHex()     * @see #HEX_PREFIX     */    public static void setHexPrefix(String newPrefix)    {        HEX_PREFIX = newPrefix;    }    /**     * Sets the global AsnOctetsPrintableFace printableObject. This     * object will be used in the toString() and the     * toInternationalDisplayString() methods.     *     * @see #toString     * @see #toInternationalDisplayString     * @since 4_14     */    public static void setPrintable(AsnOctetsPrintableFace obj)    {        if (obj != null)        {            printableObject = obj;        }    }    /**      * Returns the String value. Calls toString().     *     * @return The value of the AsnOctets     * @see #toString()     */    public String getValue()    {        return toString();    }    /**      * Returns the bytes. This returns a copy of the internal byte array.     *     * @return The bytes of the AsnOctets     */    public byte[] getBytes()    {        int len = value.length;        byte [] bytea = new byte[len];        System.arraycopy(value, 0, bytea, 0, len);        return bytea;    }    /**      * Returns the string representation of the AsnOctets.     * <p>     * The string will have one of the following formats:     * <ul>     * <li>if this class represents an IP Address (v4), it will call     * toIpAddress()</li>      * <li>&lt;prefix&gt;aa[:bb]*, if this class represents a non-printable     * string or has type OPAQUE.      * The output will be in hexadecimal numbers (see toHex()). It will be prefixed     * according to the hex. prefix value</li>      * <li>a printable string, if this class seems printable</li>      * </ul>     * </p>     *     * <p>     * When the type is ASN_OCTET_STR, this method uses the     * AsnOctetsPrintableFace.isPrintable() to determine whether or not     * the string is printable. If it is printable, it will use     * AsnOctetsPrintableFace.toInternationalDisplayString() to     * transform the Octets to a String.     * </p>     *     * <br/>     * Note, the SNMP representation of IPv4 and IPv6 is different:     * <ul>     *    <li>IPv4: IPADDRESS (or ASN_OCTET_STR, see rfc 4001)</li>     *    <li>IPv6: ASN_OCTET_STR</li>     * </ul>     * See also      * <a href="http://www.ietf.org/rfc/rfc2465.txt">IPV6-TC</a>,     * <a href="http://www.ietf.org/rfc/rfc3416.txt">SNMPv2-PDU</a>,     * <a href="http://www.ietf.org/rfc/rfc4001.txt">INET-ADDRESS-MIB</a>.     *     * @see #HEX_PREFIX     * @see #setHexPrefix(String)     * @see #toHex     * @see #toIpAddress     * @see AsnOctetsPrintableFace#isPrintable     * @see AsnOctetsPrintableFace#toInternationalDisplayString     * @return The string representation of the AsnOctets     */    public String toString()    {        return toString(printableObject);    }    /**     * As toString(), but this methods will use this specific, one-off     * AsnOctetsPrintableFace object.     *     * @see #toString()     * @since 4_14     */    public String toString(AsnOctetsPrintableFace face)    {        String str = "";        if (type == IPADDRESS)        {            // for IPv4 only            str = toIpAddress();        }        else if (type == OPAQUE)        {            str = HEX_PREFIX + toHex();         }        else        {            boolean isPrintable = face.isPrintable(value);            if (isPrintable)            {                str = face.toInternationalDisplayString(value);            }            else            {                str = HEX_PREFIX + toHex();             }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产视频一区二区| 成人国产视频在线观看| 成人永久免费视频| 色88888久久久久久影院野外| 欧美精品一级二级| 中文字幕亚洲区| 蜜臀av性久久久久蜜臀aⅴ四虎| 丁香婷婷综合激情五月色| 欧美性感一类影片在线播放| 久久婷婷国产综合精品青草| 亚洲成a人片在线不卡一二三区| 国产91丝袜在线18| 日韩欧美在线一区二区三区| 亚洲图片一区二区| 成人手机在线视频| 精品国产伦一区二区三区免费| 亚洲国产aⅴ成人精品无吗| 不卡的av电影在线观看| 精品久久久久一区二区国产| 午夜天堂影视香蕉久久| 91麻豆swag| 国产精品美女久久久久久| 国产精品一区免费在线观看| 日韩精品专区在线| 日韩国产欧美在线观看| 91成人在线免费观看| 自拍偷拍国产亚洲| 成人av综合在线| 国产精品人妖ts系列视频| 国产精品系列在线播放| 精品久久久影院| 国产乱码精品一区二区三区五月婷| 日韩一区二区在线观看| 日韩不卡在线观看日韩不卡视频| 欧美亚洲国产bt| 亚洲成人精品一区| 3d成人h动漫网站入口| 偷偷要91色婷婷| 欧美一区二区成人| 麻豆成人av在线| 久久综合狠狠综合久久综合88| 激情欧美一区二区| 久久久久国色av免费看影院| 成人永久aaa| 亚洲欧美日韩小说| 欧美体内she精高潮| 日本视频中文字幕一区二区三区| 欧美一区二区性放荡片| 国产自产高清不卡| 中文字幕欧美国产| 91激情五月电影| 午夜av区久久| 精品处破学生在线二十三| 国产成人免费在线视频| 中文字幕一区二区三| 欧美日韩免费高清一区色橹橹| 亚洲电影一区二区| 日韩精品一区二区三区中文不卡| 国产成人一区在线| 伊人夜夜躁av伊人久久| 欧美一级免费大片| 国产露脸91国语对白| 亚洲天堂网中文字| 欧美精品v日韩精品v韩国精品v| 精品一区二区三区免费观看| 国产精品欧美一级免费| 欧美无砖砖区免费| 精品在线视频一区| 亚洲免费观看高清完整版在线 | 国产亚洲一区二区三区在线观看| 成人小视频免费观看| 夜夜夜精品看看| 精品免费国产二区三区| 91激情在线视频| 国产伦精品一区二区三区在线观看| 日韩美女视频一区| 3d成人h动漫网站入口| proumb性欧美在线观看| 日韩二区在线观看| 中文字幕在线不卡一区二区三区| 在线综合视频播放| 成人在线视频首页| 久久99国产精品久久| 一区二区三区在线观看国产 | 国产精品欧美一区二区三区| 欧美日本一区二区| 91亚洲精品乱码久久久久久蜜桃| 美女高潮久久久| 无码av中文一区二区三区桃花岛| 国产精品视频一二三区| 日韩一区二区在线观看视频| 91久久精品一区二区三区| 国产毛片一区二区| 日韩精品乱码免费| 亚洲精品中文在线影院| 久久久99精品久久| 91精品国产综合久久久久久久久久| 成人精品一区二区三区四区| 狠狠色狠狠色综合系列| 日本中文字幕不卡| 亚洲午夜在线电影| 亚洲区小说区图片区qvod| 国产欧美va欧美不卡在线| 国产精品护士白丝一区av| 欧美一区二区三区思思人| 色偷偷一区二区三区| 成人app在线| 国产精品香蕉一区二区三区| 激情六月婷婷久久| 久久99精品国产麻豆婷婷| 日韩黄色免费电影| 午夜国产不卡在线观看视频| 艳妇臀荡乳欲伦亚洲一区| 亚洲伦在线观看| 国产精品乱码一区二区三区软件 | 国产精品18久久久久久久久| 久久精品99久久久| 青草国产精品久久久久久| 天天综合网 天天综合色| 亚洲午夜精品在线| 午夜精品久久久久久久99樱桃| 一区二区三区鲁丝不卡| 亚洲影院久久精品| 亚洲二区视频在线| 免费视频一区二区| 精品午夜一区二区三区在线观看 | 日韩不卡一区二区| 日韩成人免费在线| 精品一区二区三区免费毛片爱| 激情综合网激情| 粉嫩aⅴ一区二区三区四区| 成人免费不卡视频| 色综合中文综合网| 日韩在线a电影| 热久久久久久久| 久久99久久99小草精品免视看| 久久成人免费网| 国产成人精品亚洲777人妖| 盗摄精品av一区二区三区| av一区二区三区在线| 色av综合在线| 日韩视频免费观看高清完整版| 日韩精品资源二区在线| 国产精品素人一区二区| 亚洲精品乱码久久久久久日本蜜臀| 亚洲精品高清在线| 日韩电影在线观看电影| 国产原创一区二区| 欧美视频在线一区二区三区| 欧美日韩一区二区三区不卡| 欧美成人vps| 国产精品色一区二区三区| 亚洲成人免费在线观看| 国产一区福利在线| 91老师片黄在线观看| 欧美一区二区免费| 成人欧美一区二区三区白人 | 日韩女优视频免费观看| 国产精品久久久久久久久果冻传媒| 亚洲一二三四在线| 国产精品一区二区果冻传媒| 在线视频一区二区免费| 久久久精品中文字幕麻豆发布| 亚洲精选在线视频| 国内精品国产三级国产a久久| 一本一本大道香蕉久在线精品 | 成人精品鲁一区一区二区| 欧美女孩性生活视频| 国产精品国产精品国产专区不蜜| 石原莉奈在线亚洲二区| 97久久精品人人做人人爽50路| 日韩一级大片在线观看| 一区二区三区在线观看国产| 国产**成人网毛片九色| 日韩一区和二区| 亚洲成人手机在线| 95精品视频在线| 久久精品水蜜桃av综合天堂| 日韩福利电影在线| 欧美日韩国产综合一区二区| 亚洲成人资源网| 99久久精品国产导航| 2024国产精品视频| 青青草精品视频| 欧美亚洲免费在线一区| 一区二区三区四区亚洲| 成人高清视频在线| 久久久蜜桃精品| 韩国毛片一区二区三区| 91精品福利在线一区二区三区| 亚洲欧美自拍偷拍| 成人性生交大片免费看中文| 久久婷婷久久一区二区三区| 精品影视av免费| 日韩免费高清视频| 精品一区二区三区在线观看| 欧美福利一区二区| 日韩成人一级片| 欧美成人官网二区| 九一久久久久久|