Swap Bytes in byte array - CSharp System

CSharp examples for System:Byte Array

Description

Swap Bytes in byte array

Demo Code


using System.Text;
using System.Security.Principal;
using System.IO;/*ww w. ja  v  a  2  s .  c  om*/
using System;

public class Main{
        public static void SwapBytes(this byte[] bytes, int index1, int index2)
        {
            byte temp = bytes[index1];
            bytes[index1] = bytes[index2];
            bytes[index2] = temp;
        }
}

Related Tutorials