final long maxsize) {
ByteGen gen = new ByteGen();
byte[] bytes = new byte[new PositiveIntegerGen().arbitrary(random,
minsize, Math.min(maxsize, 2000))]; // FIXME: arbitrary length of this array to avoid OutOfMemoryError
for (int i = 0; i < bytes.length; i++) {
bytes[i] = gen.arbitrary(random, minsize, maxsize);
}
return new BigInteger(new PositiveIntegerGen().arbitrary(random,
minsize, maxsize) > 0 ? 1 : -1, bytes);
}
}