List of utility methods to do BigInteger Calculate
void | writeBigInteger(ByteArrayOutputStream baos, BigInteger bi) write Big Integer writeData(baos, bi.toByteArray()); |
void | writeBigInteger(ByteArrayOutputStream stream, BigInteger num) write Big Integer int length = num.toByteArray().length; byte[] data = new byte[4]; data[0] = (byte) ((length >> 24) & 0xFF); data[1] = (byte) ((length >> 16) & 0xFF); data[2] = (byte) ((length >> 8) & 0xFF); data[3] = (byte) (length & 0xFF); stream.write(data); stream.write(num.toByteArray()); ... |
void | writeBigInteger(OutputStream output, BigInteger value) Write the arbitrarily sized signed BigInteger in vint format. value = value.shiftLeft(1); int sign = value.signum(); if (sign < 0) { value = value.negate(); value = value.subtract(BigInteger.ONE); int length = value.bitLength(); while (true) { ... |
void | writeField(String tagName, BigInteger value, PrintWriter writer, int indent) adds a child to the element with the given name and the given value. If value is null, nothing is done if (value == null) return; writeField(tagName, value.toString(), writer, indent); |
void | writeLuposBigInteger(final BigInteger value, final int numberOfBits, final OutputStream os) writeLuposBigInteger. int remainingBits = numberOfBits; BigInteger remainingValue = value; final BigInteger BYTE = BigInteger.valueOf(256); while (remainingBits > 0) { final BigInteger[] result = remainingValue.divideAndRemainder(BYTE); remainingValue = result[0]; os.write((byte) result[1].intValue()); remainingBits -= 8; ... |
void | writeMPI(BigInteger num, OutputStream out) write MPI out.write(MPIbytes(num)); |