reverse byte array - CSharp System

CSharp examples for System:Byte Array

Description

reverse byte array

Demo Code


using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;/*from   w  w w .  j  av  a2  s  .c  o m*/

public class Main{
        public static void reverse(byte[] arr)
        {
            for (int i = 0; i < arr.Length / 2; i++)
            {
                byte tmp = arr[i];
                arr[i] = arr[arr.Length - i - 1];
                arr[arr.Length - i - 1] = tmp;
            }
        }
}

Related Tutorials