public virtual int NextInt() { byte[] intBytes = new byte[4]; NextBytes(intBytes); int result = 0; for (int i = 0; i < 4; i++) { result = (result << 8) + (intBytes[i] & 0xff); } return result; }