fork(2) download
  1. class Program
  2. {
  3. static void Main()
  4. {
  5. byte[] byteArray = { 0x08, 0x00 };
  6.  
  7. byte hiByte = byteArray[0]; // or as appropriate
  8. byte lowByte = byteArray[1];
  9. short val = (short)((hiByte << 8) | lowByte);
  10.  
  11. System.Console.WriteLine(val.ToString("X4"));
  12. System.Console.WriteLine(val.ToString());
  13. }
  14. }
Success #stdin #stdout 0.03s 36968KB
stdin
Standard input is empty
stdout
0800
2048