Gets highest byte of an unsigned 16 bit integer - CSharp System

CSharp examples for System:Int32

Description

Gets highest byte of an unsigned 16 bit integer

Demo Code

// Copyright (c) 2013-2015 Laszlo Arvai. All rights reserved.
using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;/*from ww w  .  j  av a  2  s .  c  o m*/

public class Main{
        /// <summary>
      /// Gets highest byte of an unsigned 16 bit integer
      /// </summary>
      /// <param name="in_value"></param>
      /// <returns></returns>
      public static byte HighByte(UInt16 in_value)
      {
         return (byte)((in_value >> 8) & 0xff);
      }
}

Related Tutorials