コード例 #1
0
        private byte[] changeExpandBuffer(DataElement obj, generateFcn generate)
        {
            // expand the size of our buffer
            var data = obj.Value.Value;
            int size = context.Random.Next(256);
            int pos  = context.Random.Next(data.Length);

            return(generate(data, pos, size));
        }
コード例 #2
0
        private BitwiseStream changeExpandBuffer(DataElement obj, generateFcn generate)
        {
            // expand the size of our buffer
            var  data = obj.Value;
            long size = context.Random.Next(256);
            long pos  = context.Random.Next(data.Length);

            // Copy first 'pos' bytes
            var ret = copyBytes(data, pos);

            // Generate 'size' bytes
            generate(ret, size);

            // Copy from 'pos' onwards
            data.CopyTo(ret);

            return(ret);
        }