code: public static int sizeOfInteger(int value) {
          int contentLength = 0;
          do {
              value >>>= 8;
              contentLength++;
          } while (value != 0);
          return DerUtils.sizeOf(ASN1_INTEGER_TAG_NUM, contentLength);
      }
docs: Size of an ASN.1 INTEGER.
  
  @param value
  the integer value
  @return the size of the encoded data