Convert byte array To Int8 - CSharp System

CSharp examples for System:Byte Array

Description

Convert byte array To Int8

Demo Code


using System.Text;
using System;//from  w  w w.  j  a v a2s .co m

public class Main{
        public static sbyte[] ToInt8(byte[] source, int sourceOffset, int size)
        {
            var bytes = new sbyte[size];

            for (int i = 0; i < size; i++)
                bytes[i] = unchecked((sbyte)source[i + sourceOffset]);

            return bytes;
        }
}

Related Tutorials