Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.5
-
None
-
None
-
Patch, Important
Description
Sequential calls to the BitsStreamGenerator#nextBytes(byte[]) must generate the same sequence of bytes, no matter by chunks of which size it was divided. This is also how java.util.Random#nextBytes(byte[]) works.
When nextBytes(byte[]) is called with a bytes array of length multiple of 4 it makes one unneeded call to next(int) method. This is wrong and produces an inconsistent behavior of classes like MersenneTwister.
I made a new implementation of the BitsStreamGenerator#nextBytes(byte[]) see attached code.