title: Please verify: this converter reads the byte array as Big-Endian?
body: <p>I am porting some stuff from C# to Java and I need a class that can convert bytes to primitives, just like BitConverter in .NET can.</p>
  
  <p>As I just posted <a href="https://stackoverflow.com/questions/2023672/islittleendian-field-reports-false-but-it-must-be-little-endian">here</a>, I noted that my computer uses Little-Endian (Intel) and BitConverter works as expected:</p>
  
  <pre><code>// C# code
  byte[] b2 = new byte[] { 0, 1 };
  short b2short = BitConverter.ToInt16(b2, 0);
  </code></pre>
  
  <p>the <i>b2short</i> == 256 as expected. </p>
  
  <p>Well, I needed a "BitConverter" in JAVA and found <a href="http://www.daniweb.com/code/snippet216874.html" rel="nofollow noreferrer">this piece of code</a>. However, when I try it in JAVA it seems to me that the methods interpret the byte arrays as Big-Endian. JAVA-code:</p>
  
  <pre><code>// JAVA code
  byte[] b2 = new byte[] { 0, 1 };
  short b2short = MyFoundConverter.BitConverter.toShort(b2, 0);
  </code></pre>
  
  <p>In this case, <i>b2short</i> == 1 and that seems to me like Big-Endian.</p>
  
  <p>Is the code found <a href="http://www.daniweb.com/code/snippet216874.html" rel="nofollow noreferrer">on this webpage</a> interpreting the byte array as Big-Endian?</p>
  
  <p>If so, is there an easy way to make it Little-Endian?</p>