beta.blog

C# – Convert UInt16 To Byte Array

by on Aug.16, 2012, under Programming

This is how to programmatically convert a UInt16 into a byte array in C-Sharp.

UInt16 u = 3;
byte[] b = BitConverter.GetBytes(u);

Note: The BitConverter class is part of the System namespace.


1 Comment for this entry

  • Tech

    Hurrah, that’s what I was searching for, what a material!
    existing here at this blog, thanks admin of this website.

Leave a Reply

*

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!