title: writing int to bytes with value greater than 255
body: <p>the problem is i'm trying to analyze a binary file.
  then i'm kinda stuck how to convert int to byte with value greater than 255
  for example i have 0x17b how can i right that as a bytes in file ?</p>
  
  <p>while examining the binary file i notice that 0x17b is equal to 0xfb 0x02 (in bytes)
  how did that happen ?</p>
  
  <p>in c# i tried</p>
  
  <pre><code>Convert.ToByte(search.Length)
  </code></pre>
  
  <p>and it gives and error that cannot convert into byte because it has more than 255 value in it as in byte the higher byte is <code>ff</code></p>
  
  <p>here's another example for reference</p>
  
  <pre><code>0x107 = 0x87 0x02 (in bytes)
  0x17B = 0xFB 0x02 (in bytes)
  0xAD = 0xAD 0x01 (in bytes)
  </code></pre>