fill long to Byte array - CSharp System

CSharp examples for System:Byte Array

Description

fill long to Byte array

Demo Code

/// Distributed under the Mozilla Public License                            *
using System;/*  www  .  j a va  2  s. c o  m*/

public class Main{
        public static void  fillBytes(byte[] byteArray, long value_Renamed, int cnt, int index)
        {
            
            for (int i = 0; i < cnt; i++)
            {
                byteArray[cnt - i - 1 + index] = (byte) (value_Renamed & 0xff);
                value_Renamed >>= 8;
            }
        }
}

Related Tutorials