Description
The seed conversion routines in ByteArray2LongArray and ByteArray2IntArray can be optimised for memory usage.
The converters can be updated to implement Seed2ArrayConverter. This allows the length of the output seed to be constructed to the correct length. This will avoid converting part of the byte[] seed that is not used.
In addition the input seed is expanded if it is not modulus 8 or 4 respectively using Arrays.copyOf. This will zero fill the end of the seed. The array can then be converted by the NumberFactory without an exception.
These routines should be updated to use the same method as NumberFactory to fill in a long[] and then add any trailing bytes to the final long.
This avoids any array copy when using arbitrary seed lengths, e.g. SecureRandom.getSeed(13).