All pastes #909206 Raw Edit

Miscellany

public text v1 · immutable
·published 2008-02-18 23:42 UTC
rendered paste body
		internal void StaticArray (string name, byte[] arr)
		{
			this.LABEL (name);
			this.AddArrayFields (arr.Length);

/* method 1 */			
			int len = arr.Length;
			int i = 0;
			while (len >= 4) {
				this.DATA (arr[i]);
				this.DATA (arr[i+1]);
				this.DATA (arr[i+2]);
				this.DATA (arr[i+3]);
				i+=4;
				len-=4;
			}
			while (i < arr.Length) {
				this.DATA (arr[i]);
				i++;
			}

/* method 2 */			
			foreach (byte b in arr)
				this.DATA (b);
		}