// Path: prngine/src/main/java/io/jenetics/prngine/Bytes.java
// static int readInt(final byte[] bytes, final int index) {
// 	final int offset = index*Integer.BYTES;
// 	if (offset + Integer.BYTES > bytes.length) {
// 		throw new IndexOutOfBoundsException(format(
// 			"Not enough data to read int value (index=%d, bytes=%d).",
// 			index, bytes.length
// 		));
// 	}
// 
// 	return
// 		((bytes[offset    ] & 255) << 24) +
// 		((bytes[offset + 1] & 255) << 16) +
// 		((bytes[offset + 2] & 255) << 8) +
// 		((bytes[offset + 3] & 255));
// }


import java.util.List;
import static java.lang.String.format;
import static java.util.Objects.requireNonNull;
import static io.jenetics.prngine.Bytes.readInt;
	public XOR32ShiftRandom(final byte[] seed) {
		this(Param.DEFAULT, seed);
	}

	/**
	 * Create a new PRNG instance with {@link Param#DEFAULT} parameter and the
	 * given seed.
	 *
	 * @param seed the seed of the PRNG
	 */
	public XOR32ShiftRandom(final long seed) {
		this(Param.DEFAULT, Seeds.expandSeedToBytes(seed, SEED_BYTES));
	}

	/**
	 * Create a new PRNG instance with {@link Param#DEFAULT} parameter and safe
	 * seed.
	 */
	public XOR32ShiftRandom() {
		this(Param.DEFAULT, Seeds.seed());
	}

	private void setSeed(final byte[] seed) {
		if (seed.length < SEED_BYTES) {
			throw new IllegalArgumentException(format(
				"Required %d seed bytes, but got %d.",
				SEED_BYTES, seed.length
			));
		}

// Path: prngine/src/main/java/io/jenetics/prngine/Bytes.java
// static int readInt(final byte[] bytes, final int index) {
// 	final int offset = index*Integer.BYTES;
// 	if (offset + Integer.BYTES > bytes.length) {
// 		throw new IndexOutOfBoundsException(format(
// 			"Not enough data to read int value (index=%d, bytes=%d).",
// 			index, bytes.length
// 		));
// 	}
// 
// 	return
// 		((bytes[offset    ] & 255) << 24) +
// 		((bytes[offset + 1] & 255) << 16) +
// 		((bytes[offset + 2] & 255) << 8) +
// 		((bytes[offset + 3] & 255));
// }


// Path: prngine/src/main/java/io/jenetics/prngine/XOR32ShiftRandom.java
import java.util.List;
import static java.lang.String.format;
import static java.util.Objects.requireNonNull;
import static io.jenetics.prngine.Bytes.readInt;

	public XOR32ShiftRandom(final byte[] seed) {
		this(Param.DEFAULT, seed);
	}

	/**
	 * Create a new PRNG instance with {@link Param#DEFAULT} parameter and the
	 * given seed.
	 *
	 * @param seed the seed of the PRNG
	 */
	public XOR32ShiftRandom(final long seed) {
		this(Param.DEFAULT, Seeds.expandSeedToBytes(seed, SEED_BYTES));
	}

	/**
	 * Create a new PRNG instance with {@link Param#DEFAULT} parameter and safe
	 * seed.
	 */
	public XOR32ShiftRandom() {
		this(Param.DEFAULT, Seeds.seed());
	}

	private void setSeed(final byte[] seed) {
		if (seed.length < SEED_BYTES) {
			throw new IllegalArgumentException(format(
				"Required %d seed bytes, but got %d.",
				SEED_BYTES, seed.length
			));
		}

		x = toSafeSeed(readInt(seed, 0));