Convert int To Unsigned Byte - CSharp System

CSharp examples for System:Int32

Description

Convert int To Unsigned Byte

Demo Code


using System.Net;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;/*  w  w  w . j av a  2  s. c  o  m*/

public class Main{
        public static short ToUnsignedByte(int value)
        {
            return (short)(((byte)value) & 0xff);
        }
        public static short ToUnsignedByte(byte value)
        {
            return (short)(value & 0xff);
        }
}

Related Tutorials