private int[] toIntArray(){
  int length=encoding.length;
  int[] result=new int[20];
  int which=0;
  int fromPos=0;
  for (int i=0; i < length; i++) {
    if ((encoding[i] & 0x80) == 0) {
      if (i - fromPos + 1 > 4) {
        BigInteger big=new BigInteger(pack(encoding,fromPos,i - fromPos + 1,7,8));
        if (fromPos == 0) {
          result[which++]=2;
          BigInteger second=big.subtract(BigInteger.valueOf(80));
          if (second.compareTo(BigInteger.valueOf(Integer.MAX_VALUE)) == 1) {
            return null;
          }
 else {
            result[which++]=second.intValue();
          }
        }
 else {
          if (big.compareTo(BigInteger.valueOf(Integer.MAX_VALUE)) == 1) {
            return null;
          }
 else {
            result[which++]=big.intValue();
          }
        }
      }
 else {
        int retval=0;
        for (int j=fromPos; j <= i; j++) {
          retval<<=7;
          byte tmp=encoding[j];
          retval|=(tmp & 0x07f);
        }
        if (fromPos == 0) {
          if (retval < 80) {
            result[which++]=retval / 40;
            result[which++]=retval % 40;
          }
 else {
            result[which++]=2;
            result[which++]=retval - 80;
          }
        }
 else {
          result[which++]=retval;
        }
      }
      fromPos=i + 1;
    }
    if (which >= result.length) {
      result=Arrays.copyOf(result,which + 10);
    }
  }
  return Arrays.copyOf(result,which);
}

private int [ ] toIntArray ( ) { int length = encoding . length ; int [ ] result = new int [ 20 ] ; int which = 0 ; int fromPos = 0 ; for ( int i = 0 ; i < length ; i ++ ) { if ( ( encoding [ i ] & 0x80 ) == 0 ) { if ( i - fromPos + 1 > 4 ) { BigInteger big = new BigInteger ( pack ( encoding , fromPos , i - fromPos + 1 , 7 , 8 ) ) ; if ( fromPos == 0 ) { result [ which ++ ] = 2 ; BigInteger second = big . subtract ( BigInteger . valueOf ( 80 ) ) ; if ( second . compareTo ( BigInteger . valueOf ( Integer . MAX_VALUE ) ) == 1 ) { return null ; } else { result [ which ++ ] = second . intValue ( ) ; } } else { if ( big . compareTo ( BigInteger . valueOf ( Integer . MAX_VALUE ) ) == 1 ) { return null ; } else { result [ which ++ ] = big . intValue ( ) ; } } } else { int retval = 0 ; for ( int j = fromPos ; j <= i ; j ++ ) { retval <<= 7 ; byte tmp = encoding [ j ] ; retval |= ( tmp & 0x07f ) ; } if ( fromPos == 0 ) { if ( retval < 80 ) { result [ which ++ ] = retval / 40 ; result [ which ++ ] = retval % 40 ; } else { result [ which ++ ] = 2 ; result [ which ++ ] = retval - 80 ; } } else { result [ which ++ ] = retval ; } } fromPos = i + 1 ; } if ( which >= result . length ) { result = Arrays . copyOf ( result , which + 10 ) ; } } return Arrays . copyOf ( result , which ) ; }
private helper method for serialization . to be compatible with old versions of jdk .
