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

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

?? ber.java.svn-base

?? snmp hibernate 源碼, 類似hibernate的映射.
?? SVN-BASE
?? 第 1 頁 / 共 2 頁
字號:
      }
    }
  }


  public static final void encodeUnsignedInt64(OutputStream os, byte type, long value)
      throws IOException
  {
    int len;
    /*
     * Truncate "unnecessary" bytes off of the most significant end of this
     * 2's complement integer.  There should be no sequence of 9
     * consecutive 1's or 0's at the most significant end of the
     * integer.
     */
    for (len = 8; len > 1; len--) {
      if (((value >> (8 * (len - 1))) & 0xFF) != 0) {
        break;
      }
    }
    if ((( value >> (8 * (len -1))) & 0x080) !=0) {
      len++;
    }
    encodeHeader(os, type, len);
    if (len == 9) {
      os.write(0);
      len--;
    }
    for (int x=0; x<len; x++) {
      os.write((int) (value >> (8 * ((len - 1) - x) & LENMASK)));
    }
  }

  /**
   * Decodes a ASN.1 length.
   * @param is
   *    an <code>InputStream</code>
   * @return
   *    the decoded length.
   * @throws IOException
   */
  public static final int decodeLength(BERInputStream is)
      throws IOException
  {
    return decodeLength(is, true);
  }

  /**
   * Decodes a ASN.1 length.
   * @param is
   *    an <code>InputStream</code>
   * @param checkLength
   *    if <code>false</code> length check is always suppressed.
   * @return
   *    the decoded length.
   * @throws IOException
   */
  public static final int decodeLength(BERInputStream is, boolean checkLength)
      throws IOException
  {
    int length = 0;
    int lengthbyte = is.read();

    if ((lengthbyte & ASN_LONG_LEN) > 0) {
      lengthbyte &= ~ASN_LONG_LEN;	/* turn MSb off */
      if (lengthbyte == 0){
        throw new IOException("Indefinite lengths are not supported");
      }
      if (lengthbyte > 4){
        throw new IOException("Data length > 4 bytes are not supported!");
      }
      for (int i=0; i<lengthbyte; i++) {
        int l = is.read() & 0xFF;
        length |= (l << (8*((lengthbyte-1)-i)));
      }
      if (length < 0) {
         throw new IOException("SNMP does not support data lengths > 2^31");
      }
    }
    else { /* short asnlength */
      length = lengthbyte & 0xFF;
    }
    /**
     * If activated we do a length check here: length > is.available() -> throw
     * exception
     */
    if (checkLength) {
      checkLength(is, length);
    }
    return length;
  }

  /**
   * Decodes an ASN.1 header for an object with the ID and
   * length specified.
   *  On entry, datalength is input as the number of valid bytes following
   *   "data".  On exit, it is returned as the number of valid bytes
   *   in this object following the id and length.
   *
   *  This only works on data types < 30, i.e. no extension octets.
   *  The maximum length is 0xFFFF;
   *
   * @param is
   *   the BERInputStream to decode.
   * @param type
   *   returns the type of the object at the current position in the input
   *   stream.
   * @param checkLength
   *    if <code>false</code> length check is always suppressed.
   * @return
   *   the decoded length of the object.
   * @throws IOException
   */
  public static final int decodeHeader(BERInputStream is, MutableByte type,
                                       boolean checkLength)
      throws IOException
  {
    /* this only works on data types < 30, i.e. no extension octets */
    byte t = (byte)is.read();
    if ((t & ASN_EXTENSION_ID) == ASN_EXTENSION_ID) {
      throw new IOException("Cannot process extension IDs"+
                            getPositionMessage(is));
    }
    type.setValue(t);
    return decodeLength(is, checkLength);
  }

  /**
   * Decodes an ASN.1 header for an object with the ID and
   * length specified.
   *  On entry, datalength is input as the number of valid bytes following
   *   "data".  On exit, it is returned as the number of valid bytes
   *   in this object following the id and length.
   *
   *  This only works on data types < 30, i.e. no extension octets.
   *  The maximum length is 0xFFFF;
   *
   * @param is
   *   the BERInputStream to decode.
   * @param type
   *   returns the type of the object at the current position in the input
   *   stream.
   * @return
   *   the decoded length of the object.
   * @throws IOException
   */
  public static final int decodeHeader(BERInputStream is, MutableByte type)
      throws IOException
  {
    return decodeHeader(is, type, true);
  }

  public static final int decodeInteger(BERInputStream is, MutableByte type)
      throws IOException
  {
    int length;
    int value = 0;

    type.setValue((byte)is.read());

    if ((type.value != 0x02) && (type.value != 0x43) &&
        (type.value != 0x41)) {
      throw new IOException("Wrong ASN.1 type. Not an integer: "+type.value+
                            getPositionMessage(is));
    }
    length = decodeLength(is);
    if (length > 4) {
      throw new IOException("Length greater than 32bit are not supported "+
                            " for integers: "+getPositionMessage(is));
    }
    int b = is.read() & 0xFF;
    if ((b & 0x80) > 0) {
      value = -1; /* integer is negative */
    }
    while (length-- > 0) {
      value = (value << 8) | b;
      if (length > 0) {
        b = is.read();
      }
    }
    return value;
  }

  private static String getPositionMessage(BERInputStream is) {
    return " at position "+is.getPosition();
  }

  public static final long decodeUnsignedInteger(BERInputStream is, MutableByte type)
      throws IOException
  {
    int	length;
    long value = 0;

    // get the type
    type.setValue((byte)is.read());
    if ((type.value != 0x02) && (type.value != 0x43) &&
        (type.value != 0x41) && (type.value != 0x42) &&
        (type.value != 0x47)) {
      throw new IOException("Wrong ASN.1 type. Not an unsigned integer: "+
                            type.value+
                            getPositionMessage(is));
    }
    // pick up the len
    length = decodeLength(is);

    // check for legal uint size
    int b = is.read();
    if ((length > 5) || ((length > 4) && (b != 0x00))) {
      throw new IOException("Only 32bit unsigned integers are supported"+
                            getPositionMessage(is));
    }

    // check for leading  0 octet
    if (b == 0x00) {
      if (length > 1) {
        b = is.read();
      }
      length--;
    }

    // calculate the value
    for (int i=0; i<length; i++) {
      value = (value << 8) | (b & 0xFF);
      if (i+1<length) {
        b = is.read();
      }
    }
    return value;
  }

  public static final byte[] decodeString(BERInputStream is, MutableByte type)
      throws IOException
  {
    /*
     * ASN.1 octet string ::= primstring | cmpdstring
     * primstring ::= 0x04 asnlength byte {byte}*
     * cmpdstring ::= 0x24 asnlength string {string}*
     * ipaddress  ::= 0x40 4 byte byte byte byte
     */
    // get the type
    type.setValue((byte)is.read());
    if ((type.value != BER.OCTETSTRING) && (type.value != 0x24) &&
        (type.value != BER.IPADDRESS) && (type.value != BER.OPAQUE) &&
        (type.value != BER.BITSTRING) &&
        (type.value != 0x45)) {
      throw new IOException("Wrong ASN.1 type. Not a string: "+type.value+
                            getPositionMessage(is));
    }
    int length = decodeLength(is);

    byte[] value = new byte[length];
    int pos = 0;

    while ((pos < length) && (is.available()>0)) {
      int read = is.read(value);
      if (read > 0) {
        pos += read;
      }
      else if (read < 0) {
        throw new IOException("Wrong string length "+read+" < "+length);
      }
    }
    return value;
  }


  public static final int[] decodeOID(BERInputStream is, MutableByte type)
      throws IOException
  {
    /*
     * ASN.1 objid ::= 0x06 asnlength subidentifier {subidentifier}*
     * subidentifier ::= {leadingbyte}* lastbyte
     * leadingbyte ::= 1 7bitvalue
     * lastbyte ::= 0 7bitvalue
     */
    int subidentifier;
    int length;

    // get the type
    type.setValue((byte)is.read());
    if (type.value != 0x06) {
      throw new IOException("Wrong type. Not an OID: "+type.value+
                            getPositionMessage(is));
    }
    length = decodeLength(is);

    int[] oid = new int[length+2];
    /* Handle invalid object identifier encodings of the form 06 00 robustly */
    if (length == 0) {
      oid[0] = oid[1] = 0;
    }
    int pos = 1;
    while (length > 0){
      subidentifier = 0;
      int b;
      do {	/* shift and add in low order 7 bits */
        int next = is.read();
        if (next < 0) {
          throw new IOException("Unexpected end of input stream" +
                                getPositionMessage(is));
        }
        b = next & 0xFF;
        subidentifier = (subidentifier << 7) + (b & ~ASN_BIT8);
        length--;
      } while ((length > 0) && ((b & ASN_BIT8) != 0));	/* last byte has high bit clear */
      oid[pos++] = subidentifier;
    }

    /*
    * The first two subidentifiers are encoded into the first component
    * with the value (X * 40) + Y, where:
    *	X is the value of the first subidentifier.
    *  Y is the value of the second subidentifier.
    */
    subidentifier = oid[1];
    if (subidentifier == 0x2B){
      oid[0] = 1;
      oid[1] = 3;
    }
    else {
      oid[1] = (subidentifier % 40);
      oid[0] = ((subidentifier - oid[1]) / 40);
    }
    if (pos < 2) {
      pos = 2;
    }
    int[] value = new int[pos];
    System.arraycopy(oid, 0, value, 0, pos);
    return value;
  }

  public static final void decodeNull(BERInputStream is, MutableByte type)
      throws IOException
  {
    // get the type
    type.setValue((byte)(is.read() & 0xFF));
    if ((type.value != (byte)0x05) && (type.value != (byte)0x80) &&
        (type.value != (byte)0x81) && (type.value != (byte)0x82)) {
      throw new IOException("Wrong ASN.1 type. Is not null: " + type.value+
                            getPositionMessage(is));
    }
    int length = decodeLength(is);
    if (length != 0) {
      throw new IOException("Invalid Null encoding, length is not zero: "+
                            length+getPositionMessage(is));
    }
  }

  public static final long decodeUnsignedInt64(BERInputStream is, MutableByte type)
      throws IOException
  {
    // get the type
    type.setValue((byte)is.read());
    if ((type.value != 0x02) && (type.value != 0x46)) {
      throw new IOException("Wrong type. Not an integer 64: "+type.value+
                            getPositionMessage(is));
    }
    int length = decodeLength(is);
    int b = is.read() & 0xFF;
    if (length > 9) {
      throw new IOException("Invalid 64bit unsigned integer length: "+length+
                            getPositionMessage(is));
    }
    // check for leading  0 octet
    if (b == 0x00) {
      if (length > 1) {
        b = is.read();
      }
      length--;
    }
    long value = 0;
    // calculate the value
    for (int i=0; i<length; i++) {
      value = (value << 8) | (b & 0xFF);
      if (i+1<length) {
        b = is.read();
      }
    }
    return value;
  }

  /**
   * Gets the SEQUENCE length checking mode.
   * @return
   *    <code>true</code> if the length of a parsed SEQUENCE should be checked
   *    against the real length of the objects parsed.
   */
  public static boolean isCheckSequenceLength() {
    return checkSequenceLength;
  }

  /**
   * Sets the application wide SEQUENCE length checking mode.
   * @param checkSequenceLen
   *    specifies whether he length of a parsed SEQUENCE should be checked
   *    against the real length of the objects parsed.
   */
  public static void setCheckSequenceLength(boolean checkSequenceLen) {
    checkSequenceLength = checkSequenceLen;
  }

  public static void checkSequenceLength(int expectedLength,
                                         BERSerializable sequence)
      throws IOException
  {
    if ((isCheckSequenceLength()) &&
        (expectedLength != sequence.getBERPayloadLength())) {
      throw new IOException("The actual length of the SEQUENCE object "+
                            sequence.getClass().getName()+
                            " is "+sequence.getBERPayloadLength()+", but "+
                            expectedLength+" was expected");
    }
  }

  public static void checkSequenceLength(int expectedLength, int actualLength,
                                         BERSerializable sequence)
      throws IOException
  {
    if ((isCheckSequenceLength()) &&
        (expectedLength != actualLength)) {
      throw new IOException("The actual length of the SEQUENCE object "+
                            sequence.getClass().getName()+
                            " is "+actualLength+", but "+
                            expectedLength+" was expected");
    }
  }

  /**
   * Checks whether the length of that was encoded is also available from the
   * stream.
   *
   * @param is InputStream
   * @param length int
   * @throws IOException
   *    if the bytes that are given in length cannot be read from the input
   *    stream (without blocking).
   */
  private static void checkLength(BERInputStream is, int length) throws
      IOException {
    if (!checkValueLength) {
      return;
    }
    if ((length < 0) || (length > is.getAvailableBytes())) {
      throw new IOException("The encoded length "+
                            length+
                            " exceeds the number of bytes left in input"+
                            getPositionMessage(is)+
                            " which actually is "+is.getAvailableBytes());
    }
  }

  public boolean isCheckValueLength() {
    return checkValueLength;
  }

  public void setCheckValueLength(boolean checkValueLength) {
    BER.checkValueLength = checkValueLength;
  }

}


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品在线看片z| 国产精品一区二区无线| 人人精品人人爱| 国产一区二区视频在线| 91视频xxxx| 欧美一区午夜精品| 久久久精品tv| 亚洲最快最全在线视频| 韩日精品视频一区| 一本一本久久a久久精品综合麻豆| 欧美日韩一本到| 久久久不卡网国产精品一区| 亚洲综合激情网| 国产在线观看免费一区| 色呦呦国产精品| 精品国产乱码91久久久久久网站| 亚洲视频在线观看一区| 久久精品国内一区二区三区| www.爱久久.com| 日韩久久免费av| 一区二区在线观看免费视频播放| 麻豆精品视频在线观看免费 | 欧美日韩精品综合在线| 国产亚洲一区二区三区四区 | 在线不卡的av| 日韩一区中文字幕| 麻豆精品一二三| 欧美羞羞免费网站| 国产精品视频一区二区三区不卡| 视频一区二区三区入口| 99r国产精品| 国产午夜精品一区二区三区嫩草| 午夜成人在线视频| 色av一区二区| 亚洲国产成人午夜在线一区| 日本v片在线高清不卡在线观看| 色综合天天性综合| 国产亚洲自拍一区| 久久精品国产秦先生| 欧美日韩黄视频| 伊人婷婷欧美激情| 99国产精品久久久久久久久久久 | 国产精品 欧美精品| 欧美一区二区啪啪| 亚洲第一主播视频| 色综合久久中文综合久久牛| 国产女人18水真多18精品一级做| 日日夜夜免费精品| 欧美亚洲一区二区在线观看| 国产精品国产精品国产专区不蜜| 激情六月婷婷综合| 欧美大片免费久久精品三p| 亚洲v日本v欧美v久久精品| 色久综合一二码| 最新久久zyz资源站| 成人手机电影网| 国产日韩欧美激情| 国产精品亚洲人在线观看| 91精品国产综合久久久久久久| 一级特黄大欧美久久久| 91麻豆免费在线观看| 国产精品欧美久久久久一区二区| 国产老肥熟一区二区三区| 日韩欧美黄色影院| 日韩成人一区二区| 欧美一区二区在线不卡| 日韩av中文字幕一区二区三区| 欧美视频一区二区三区在线观看| 亚洲精品国产一区二区三区四区在线| av在线不卡电影| 国产精品成人免费| 99re热这里只有精品视频| 国产精品久久夜| 99re成人在线| 伊人夜夜躁av伊人久久| 欧美自拍偷拍午夜视频| 亚洲一区二区成人在线观看| 欧美亚洲一区二区在线观看| 香蕉久久夜色精品国产使用方法 | 青娱乐精品在线视频| 91精品国产一区二区| 日本不卡123| 精品久久久影院| 国产乱对白刺激视频不卡| 中文乱码免费一区二区| 99视频精品在线| 亚洲精品乱码久久久久久| 欧美日韩一区不卡| 麻豆精品视频在线观看免费| 久久精品水蜜桃av综合天堂| 风间由美一区二区av101| 亚洲欧美在线视频| 欧美绝品在线观看成人午夜影视| 日韩成人精品视频| 久久久久88色偷偷免费| 91亚洲国产成人精品一区二三| 一区二区三区中文字幕精品精品| 色狠狠av一区二区三区| 日本视频在线一区| 久久综合狠狠综合| 一本到不卡精品视频在线观看| 午夜av一区二区| 26uuu亚洲婷婷狠狠天堂| av成人老司机| 午夜伊人狠狠久久| 精品乱码亚洲一区二区不卡| 成人国产免费视频| 亚洲网友自拍偷拍| 欧美v日韩v国产v| gogo大胆日本视频一区| 亚洲成人动漫一区| 久久久久亚洲综合| 日本黄色一区二区| 久久精品国产免费| 亚洲丝袜自拍清纯另类| 欧美一区国产二区| 懂色av一区二区三区蜜臀| 亚洲一区二区在线视频| 2020国产精品久久精品美国| 91在线视频播放地址| 蜜桃av一区二区在线观看| 中文字幕在线观看不卡视频| 67194成人在线观看| 成人爽a毛片一区二区免费| 日韩中文字幕区一区有砖一区| 国产日韩精品视频一区| 欧美日韩一二三| 成人激情黄色小说| 麻豆精品精品国产自在97香蕉| 亚洲欧美日本在线| 亚洲精品在线观看网站| 欧美亚洲动漫精品| 成人黄色在线网站| 毛片av一区二区| 亚洲女与黑人做爰| 国产欧美日韩在线看| 制服丝袜一区二区三区| 97成人超碰视| 国产精品99久| 日韩激情视频网站| 亚洲精品美腿丝袜| 亚洲国产精品成人久久综合一区| 欧美精品日韩一区| 91蜜桃在线观看| 国产91富婆露脸刺激对白| 日韩黄色免费网站| 一区二区三区加勒比av| 亚洲国产成人午夜在线一区| 欧美电影免费提供在线观看| 欧美午夜精品久久久久久超碰| 岛国av在线一区| 国模少妇一区二区三区| 日韩激情中文字幕| 亚洲成人免费在线观看| 亚洲日本韩国一区| 亚洲国产精品成人综合| 欧美精品一区二区三区蜜桃| 欧美一区二区视频免费观看| 欧洲一区二区三区在线| 91丨九色丨黑人外教| 成人午夜av电影| 成人性色生活片免费看爆迷你毛片| 麻豆国产欧美日韩综合精品二区| 亚洲国产欧美日韩另类综合 | 欧美日韩精品电影| 欧美综合色免费| 91麻豆福利精品推荐| 成人免费福利片| 国产成人综合网站| 国产精品一区二区在线观看不卡| 久久国产剧场电影| 麻豆91精品91久久久的内涵| 偷窥少妇高潮呻吟av久久免费| 亚洲一区二区美女| 亚洲福利视频一区二区| 亚洲一区二区三区四区五区黄| 亚洲精品免费电影| 亚洲一区二区在线免费看| 亚洲永久免费av| 亚洲高清免费在线| 亚洲国产精品久久一线不卡| 一区二区三区欧美在线观看| 亚洲激情在线激情| 亚洲一区二区三区自拍| 亚洲综合一二区| 偷拍一区二区三区| 美女网站色91| 国产一区在线观看视频| 国产精品一区专区| av不卡免费电影| 91丨九色porny丨蝌蚪| 欧美性淫爽ww久久久久无| 欧美色精品在线视频| 欧美日韩精品三区| 日韩天堂在线观看| 26uuu精品一区二区| 国产日韩精品一区二区浪潮av| 国产精品九色蝌蚪自拍| 亚洲激情图片一区| 丝袜亚洲另类丝袜在线|