コード例 #1
0
ファイル: RandomGen.cs プロジェクト: jorik041/ChaosUtil
 public RandomGen(RandomByteDataProvider provider, int bufferSizeInBytes)
 {
     Contract.Requires(bufferSizeInBytes >= 8);
     Contract.Requires(bufferSizeInBytes % 4 == 0);
     Contract.Requires(provider != null);
     byte[] byteBuffer = new byte[bufferSizeInBytes];
     this.buffer = new int[bufferSizeInBytes / 4];
     this.provider = (int[] randomData) =>
         {
             provider(byteBuffer);
             Buffer.BlockCopy(byteBuffer, 0, buffer, 0, bufferSizeInBytes);
         };
 }
コード例 #2
0
ファイル: RandomGen.cs プロジェクト: jorik041/ChaosUtil
 public RandomGen(RandomByteDataProvider provider, int bufferSizeInBytes)
 {
     Contract.Requires(bufferSizeInBytes >= 8);
     Contract.Requires(bufferSizeInBytes % 4 == 0);
     Contract.Requires(provider != null);
     byte[] byteBuffer = new byte[bufferSizeInBytes];
     this.buffer   = new int[bufferSizeInBytes / 4];
     this.provider = (int[] randomData) =>
     {
         provider(byteBuffer);
         Buffer.BlockCopy(byteBuffer, 0, buffer, 0, bufferSizeInBytes);
     };
 }
コード例 #3
0
		public RandomGen(RandomByteDataProvider provider, int bufferSizeInBytes)
		{
			Contract.Requires(bufferSizeInBytes >= 8);
			Contract.Requires(bufferSizeInBytes % 4 == 0);
			Contract.Requires(provider != null);
			var byteBuffer = new byte[bufferSizeInBytes];
			Buffer = new int[bufferSizeInBytes / 4];
			_provider = randomIntData =>
				{
					provider(byteBuffer);
					System.Buffer.BlockCopy(byteBuffer, 0, randomIntData, 0, bufferSizeInBytes);
				};
		}