Encodes the ShortInt16 data given. - CSharp System

CSharp examples for System:Int32

Description

Encodes the ShortInt16 data given.

Demo Code


using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;//from   w  ww . j a v a 2  s . c  om

public class Main{
        /// <summary>
        /// Encodes the Short/Int16 data given.
        /// </summary>
        /// <param name="v">The raw/decoded data.</param>
        /// <returns>Encoded data.</returns>
        public static string EncodeInt16(int v)
        {
            string t = "";
            return (t + ((char)(v >> 8)) + ((char)v));
        }
}

Related Tutorials