private void GenerateRandomData(byte[] data)
{
// this test needs the random data to be valid unicode
string s = TestUtil.RandomFixedByteLengthUnicodeString(Random(), data.Length);
var b = s.GetBytes(Utf8);
Debug.Assert(b.Length == data.Length);
System.Buffer.BlockCopy(b, 0, data, 0, b.Length);
}