cryptix.util.core
Class BI
public class BI
extends java.lang.Object
static String | dumpString(BigInteger x)
|
static String | dumpString(BigInteger x, String m) - Dump a BigInteger as a string, in a format that is easy to read for
debugging purposes.
|
static BigInteger | fromStream(InputStream is) - Read a BigInteger from a stream in Big Endian format (MSB first)
in a manner compatible with
toStream .
|
static byte[] | getMagnitude(BigInteger x) - Return the magnitude bytes of a BigInteger with no leading 0's.
|
static void | toStream(BigInteger x, OutputStream os) - Write a BigInteger to a stream in Big Endian format (MSB first)
in a manner compatible with fromStream.
|
dumpString
public static String dumpString(BigInteger x)
dumpString
public static String dumpString(BigInteger x,
String m)
Dump a BigInteger as a string, in a format that is easy to read for
debugging purposes. The string m is prepended to the start of
each line.
x
- the BigInteger to dumpm
- a string to be prepended to each line
- a String containing the dump
fromStream
public static BigInteger fromStream(InputStream is)
throws IOException
Read a BigInteger from a stream in Big Endian format (MSB first)
in a manner compatible with toStream
.
- a positive BigInteger read from the input stream in Big
Endian format (MSB first).
getMagnitude
public static byte[] getMagnitude(BigInteger x)
Return the magnitude bytes of a BigInteger with no leading 0's.
- the magnitude bytes of a BigInteger with no leading 0's.
toStream
public static void toStream(BigInteger x,
OutputStream os)
throws IOException
Write a BigInteger to a stream in Big Endian format (MSB first)
in a manner compatible with fromStream.
x
- A BigInteger to write to the output stream.os
- The output stream.