亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
亚洲午夜视频在线| 亚洲图片欧美激情| 欧美日产国产精品| 日本韩国一区二区三区| 91丨porny丨国产入口| 高清beeg欧美| 成人国产免费视频| 成人精品免费网站| 色悠悠亚洲一区二区| 色悠悠亚洲一区二区| 91黄视频在线| 欧美理论在线播放| 日韩欧美黄色影院| 国产日产欧美一区二区视频| 国产网红主播福利一区二区| 久久精品亚洲精品国产欧美| 国产精品久久久久婷婷 | 狠狠色伊人亚洲综合成人| 日本成人在线一区| 高清成人在线观看| 国产一区二区三区免费观看| 三级在线观看一区二区| 青青草91视频| 国产一区三区三区| 色综合视频一区二区三区高清| 色婷婷综合中文久久一本| 欧美精品自拍偷拍动漫精品| 精品美女一区二区| 日韩美女啊v在线免费观看| 午夜精品一区二区三区免费视频 | 国产精品自拍三区| 97久久超碰国产精品| 欧美精选在线播放| 久久久久久一二三区| 一区二区三区中文在线| 国内久久精品视频| 在线观看免费一区| 久久久久久久久一| 亚洲在线视频一区| 国产精品99久久久久久久女警| 一本色道久久综合亚洲精品按摩| 欧美一区二区三区人| 中国色在线观看另类| 日产国产高清一区二区三区| 国产.欧美.日韩| 91麻豆精品国产91久久久久久久久| 久久久www成人免费无遮挡大片| 一区二区三区四区五区视频在线观看| 日韩国产欧美在线播放| 91在线porny国产在线看| 欧美一区二区三区小说| 亚洲精品一二三| 国产精品99久| 精品国精品国产尤物美女| 亚洲一区二区三区四区五区黄| 国产酒店精品激情| 678五月天丁香亚洲综合网| 亚洲女人小视频在线观看| 国产麻豆精品在线| 91精品国模一区二区三区| 又紧又大又爽精品一区二区| 成人午夜电影久久影院| 精品国产自在久精品国产| 天天综合天天做天天综合| 91啪亚洲精品| 亚洲欧美另类小说| 不卡欧美aaaaa| 国产精品美女久久久久aⅴ | 欧美丝袜丝交足nylons图片| 亚洲色图制服丝袜| 白白色 亚洲乱淫| 国产欧美一二三区| 国产成人av自拍| 国产欧美视频一区二区| 国产精品一区在线观看乱码| 久久精品综合网| 国产精品一区二区三区网站| 久久久国产综合精品女国产盗摄| 美女视频黄久久| 日韩美女在线视频| 日韩成人精品视频| 日韩欧美一级精品久久| 美女脱光内衣内裤视频久久网站 | 久久品道一品道久久精品| 另类小说一区二区三区| 日韩欧美高清在线| 日韩福利视频导航| 精品国产伦一区二区三区免费 | 亚洲在线视频免费观看| 一本到不卡精品视频在线观看| 亚洲综合成人在线| 欧美日韩国产经典色站一区二区三区| 亚洲成人在线网站| 日韩欧美的一区| 成人动漫在线一区| 亚洲免费av高清| 欧美一级欧美三级| 国产v日产∨综合v精品视频| 国产精品萝li| 欧美伊人久久久久久久久影院 | 久久爱www久久做| 欧美经典三级视频一区二区三区| 不卡视频一二三四| 日韩成人精品在线| 国产精品久久久久久久久免费丝袜| 91丨国产丨九色丨pron| 日韩精彩视频在线观看| 久久伊人中文字幕| 色天天综合色天天久久| 日本免费在线视频不卡一不卡二 | 亚洲人成在线观看一区二区| 欧美色偷偷大香| 国产成人免费视频网站| 亚洲一级不卡视频| 久久精品夜夜夜夜久久| 欧美群妇大交群的观看方式| 国产伦精品一区二区三区免费| 亚洲免费观看高清完整| 欧美变态tickling挠脚心| 91丨porny丨蝌蚪视频| 久草精品在线观看| 亚洲图片欧美一区| 亚洲国产成人一区二区三区| 91精品国产色综合久久不卡蜜臀| 成人精品gif动图一区| 美女诱惑一区二区| 亚洲大尺度视频在线观看| 国产精品女人毛片| 精品福利视频一区二区三区| 91成人国产精品| www.日韩av| 国产91综合网| 精品一区二区久久久| 婷婷久久综合九色综合伊人色| ...xxx性欧美| 欧美国产激情二区三区| 日韩精品一区国产麻豆| 91国产成人在线| a美女胸又www黄视频久久| 国产成人免费9x9x人网站视频| 热久久国产精品| 日韩专区在线视频| 亚洲第一狼人社区| 亚洲伊人色欲综合网| 亚洲女性喷水在线观看一区| 中文字幕乱码日本亚洲一区二区| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 成人黄色在线看| 国内精品伊人久久久久av影院 | 欧美国产乱子伦 | 亚洲国产日韩在线一区模特 | 欧美性做爰猛烈叫床潮| 99精品视频在线播放观看| 成人激情免费视频| 成人午夜电影小说| 91小视频免费观看| 一本色道综合亚洲| 欧美日韩亚洲综合一区二区三区| 在线免费观看日本欧美| 欧美色电影在线| 日韩免费高清电影| 国产欧美精品区一区二区三区| 国产人伦精品一区二区| 亚洲欧洲日韩女同| 一区二区三区加勒比av| 一区二区三区中文免费| 亚洲午夜视频在线| 美女视频免费一区| 福利电影一区二区三区| 99久久综合国产精品| 欧美午夜精品久久久| 日韩一区二区三区四区五区六区| 欧美一区二区三区日韩| 欧美国产国产综合| 亚洲第一福利视频在线| 激情偷乱视频一区二区三区| 成人久久视频在线观看| 欧美三区在线观看| 日韩精品中文字幕在线不卡尤物| 中日韩免费视频中文字幕| 亚洲午夜免费视频| 国产精品自在在线| 欧美日韩精品久久久| 精品国内二区三区| 亚洲精品第1页| 精品一区二区三区不卡 | 国产一区二区三区不卡在线观看 | 国产成人精品免费网站| 欧美伊人久久大香线蕉综合69| 日韩三级伦理片妻子的秘密按摩| 国产午夜精品福利| 日韩和的一区二区| 成人国产一区二区三区精品| 91精品国产欧美一区二区成人| 国产精品久久久久久久久晋中| 日韩电影免费在线看| 一道本成人在线| 欧美国产一区二区| 捆绑调教一区二区三区| 在线观看91视频|