Package java.math

Examples of java.math.BigInteger.intValue()


        {
            BigInteger tmpValue = fieldValue;
            byte[] tmp = new byte[byteCount];
            for (int i = byteCount-1; i >= 0; i--)
            {
                tmp[i] = (byte) ((tmpValue.intValue() & 0x7f) | 0x80);
                tmpValue = tmpValue.shiftRight(7);
            }
            tmp[byteCount-1] &= 0x7f;
            out.write(tmp);
        }
View Full Code Here


                {
                    uLocal = (byte) uUnMod.subtract(pow2w).intValue();
                }
                else
                {
                    uLocal = (byte) uUnMod.intValue();
                }
                // uLocal is now in [-2^(width-1), 2^(width-1)-1]

                u[i] = uLocal;
                boolean s = true;
View Full Code Here

        ASN1Sequence  seq)
    {
        Enumeration e = seq.getObjects();

        BigInteger  version = ((DERInteger)e.nextElement()).getValue();
        if (version.intValue() != 0)
        {
            throw new IllegalArgumentException("wrong version for private key info");
        }

        algId = new AlgorithmIdentifier((ASN1Sequence)e.nextElement());
View Full Code Here

            {
                BigInteger _pathLengthConstraint = bc.getPathLenConstraint();

                if (_pathLengthConstraint != null)
                {
                    int _plc = _pathLengthConstraint.intValue();

                    if (_plc < maxPathLength)
                    {
                        maxPathLength = _plc;
                    }
View Full Code Here

            Vector primes = priv.getSmallPrimes();
            lookup = new Vector[primes.size()];
            for (int i = 0; i < primes.size(); i++)
            {
                BigInteger actualPrime = (BigInteger)primes.elementAt(i);
                int actualPrimeValue = actualPrime.intValue();

                lookup[i] = new Vector();
                lookup[i].addElement(ONE);

                if (debug)
View Full Code Here

        {
            BigInteger _pathLengthConstraint = bc.getPathLenConstraint();

            if (_pathLengthConstraint != null)
            {
                int _plc = _pathLengthConstraint.intValue();

                if (_plc < maxPathLength)
                {
                    return _plc;
                }
View Full Code Here

                      partName = "GetMessagesRequest")
            GetMessages getMessagesRequest) throws ResourceUnknownFault, UnableToGetMessagesFault {

        log.debug("GetMessages");
        BigInteger max = getMessagesRequest.getMaximumNumber();
        List<NotificationMessageHolderType> messages = getMessages(max != null ? max.intValue() : 0);
        GetMessagesResponse response = new GetMessagesResponse();
        response.getNotificationMessage().addAll(messages);
        return response;
    }
View Full Code Here

    bp = bp.stepInto(); // Step into the set of signerinfos
    bp = bp.stepInto(); // Step into the signerinfo sequence

    // make sure the version is 1
    BigInteger signerInfoVersion = bp.getIntValue();
    if (signerInfoVersion.intValue() != 1) {
      throw new CertificateException(SignedContentMessages.PKCS7_SignerInfo_Version_Not_Supported);
    }

    // PKCS7: version CMSVersion
    bp.stepOver(); // Skip the version
View Full Code Here

      PrinterPortResource printerResource      = (PrinterPortResource) getResourceContext(  ).getResource(  );
      ResourceProperty    printerJobProperties =
         printerResource.getResourcePropertySet(  ).get( PrinterPortPropertyQNames.QUEUED_JOB_COUNT );
      XmlInteger          queued               = (XmlInteger) printerJobProperties.get( 0 );
      BigInteger          bigIntegerValue      = queued.getBigIntegerValue(  );
      int                 count                = bigIntegerValue.intValue(  );
      count++;
      queued.setBigIntegerValue( BigInteger.valueOf( count ) );
   }
}
View Full Code Here

  /** start and end are BOTH inclusive */
  public static long nextLong(Random r, long start, long end) {
    assert end >= start;
    final BigInteger range = BigInteger.valueOf(end).add(BigInteger.valueOf(1)).subtract(BigInteger.valueOf(start));
    if (range.compareTo(BigInteger.valueOf(Integer.MAX_VALUE)) <= 0) {
      return start + r.nextInt(range.intValue());
    } else {
      // probably not evenly distributed when range is large, but OK for tests
      final BigInteger augend = new BigDecimal(range).multiply(new BigDecimal(r.nextDouble())).toBigInteger();
      final long result = BigInteger.valueOf(start).add(augend).longValue();
      assert result >= start;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.