BigInteger(byte[]) constructor bugfix.
Mark J. Roberts
mjr@statesmean.com
Sat Mar 31 23:25:00 GMT 2001
On Sun, 1 Apr 2001, Mark J. Roberts wrote:
> private static int[] byteArrayToIntArray(byte[] bytes, int sign)
> {
> // Determine number of words needed.
> int[] words = new int[(bytes.length + 3) / 4 + 1];
> int nwords = words.length;
>> // For simplicity, tack on an extra word of sign at the front,
> // it will be canonicalized out later. */
> if ((bytes.length % 4) != 0) words[--nwords] = sign;
Err, sorry -- the above inserted if statement was our first fix for this
problem, but later the whole line seemed superfluous. My bad.
--
Satan, oscillate my metallic sonatas!
Mark Roberts | mjr@statesmean.com
More information about the Java
mailing list