title: Python's unpack function in C#
body: <p>I am looking for a way of getting the result of this procedure in C#. To be precise, I am trying to unpack data from a binary string, according to the given format (the method should return an array). Please refer to <a href="http://docs.python.org/2/library/struct.html" rel="nofollow">http://docs.python.org/2/library/struct.html</a> for more information.</p>
  
  <pre><code>struct.unpack('!hh', data[2:6])
  </code></pre>
  
  <p>Is there a way of doing such in C#?</p>