title: How do I limit BitConverter.GetBytes() to return only a certain amount of bytes using VB.NET?
body: <p>I do:</p>
  
  <pre><code>Dim BytArr() as Byte = BitConverter.GetBytes(1234)
  </code></pre>
  
  <p>Since, by default, they are 32 bits, it returns 4 byte elements.</p>
  
  <p>I want to be able to control it to return only like two bytes. Maybe only three bytes. Are there any built-in functions to control it? </p>
  
  <p>I don't want to rely on using shifting <code>&gt;&gt; 8 &gt;&gt; 16 &gt;&gt; 24 &gt;&gt; 32</code>, etc..</p>
  
  <p>I also don't want to rely on type casting the data in GetBytes() to a specific datatype.</p>