title: extract ID from byte[]
body: <p>I read <code>byte[]</code> from socket as <code>Param_Code</code> which includes ID. </p>
  
  <pre><code>byte[] cbuf = new byte[4];
  socketReader.read(cbuf, 0, 4);
  int Param_Code = byteArrayToIntBI(cbuf, 0);
  
  public static int byteArrayToIntBI(byte[] b, int offset) {
          int value = 0;
          for (int i = 3; i &gt; -1; i--) {
              int shift = (i) * 8;
              value += (b[i + offset] &amp; 0x000000FF) &lt;&lt; shift;
          }
      return value;
     }
  </code></pre>
  
  <p>• Option 1: Sometimes the Param_code corresponds only to the ID </p>
  
  <p>• Option 2: Sometimes the Param_code corresponds to 0x40000000 + the ID</p>
  
  <p>• Option 3: Sometimes the Param_code corresponds to 0x80000000 + the ID </p>
  
  <p>My question is, How can i get ID from Param_code considering above options.</p>