package com.azure.perfstress;

import java.io.InputStream;
import java.util.Random;

public class RandomStream {
    private static final byte[] _randomBytes;

    static {
        _randomBytes = new byte[1024 * 1024];
        (new Random(0)).nextBytes(_randomBytes);
    }
    
    public static InputStream create(long size) {
        return CircularStream.create(_randomBytes, size);
    }
}

@@ -24,16 +24,53 @@
 tress;%0A%0A
+import java.io.ByteArrayInputStream;%0A
 import j
@@ -81,32 +81,32 @@
 io.InputStream;%0A
-
 import java.util
@@ -210,16 +210,19 @@
 %0A       
+ //
  _random
@@ -252,16 +252,68 @@
  1024%5D;%0A
+        _randomBytes = new byte%5BInteger.MAX_VALUE%5D;%0A
         
@@ -426,51 +426,179 @@
     
-return CircularStream.create(_randomBytes, 
+// Workaround for Azure/azure-sdk-for-java#6020%0A        // return CircularStream.create(_randomBytes, size);%0A        return new ByteArrayInputStream(_randomBytes, 0, (int)
 size

Use ByteArrayInputStream instead of CircularStream - Workaround for Azure/azure-sdk-for-java#6020