vb.net - Shifting Byte Array -


If the view is an array of bytes in the origin:

  dim data () byte In form = {0, 128, 0, 4, 9, 9, 32, 0, 0, 0, 0, 0, 0, 0}}   

What is a quick and easy The way to put two data values ​​in front of this array, and close the previous two values? dim data () byte = {128, 128, 0, 128, 0, 4, 9, 9, 32, 0, 0, 0, 0, 0,}

Yes. First of all, you need to move all of your existing values ​​into 2 places in your array. By doing this, the last 2 values ​​will be overwritten. Then you want to set the first two values ​​of your array.

  Take the data to two places, it should be done in the reverse order so that we can not lose any data. For integer = data LayLength - 1 to 2 step -1 data (i) = data (i-2) and 'assign new value data 0) = 128 data (1) = 128    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -