code: protected static int readInt(byte[] bytes, int offset, int length)
      {
          int result = 0;
          for (int i = 0; i < length; ++i)
          {
              result <<= 8;
              result += bytes[offset + i] & 0xFF;
          }
          return result;
      }
docs: Reads an integer from <code>bytes</code> in network byte order.
  
  @param bytes  The bytes from where the integer value is read
  @param offset The offset in <code>bytes</code> from where to start reading the integer
  @param length The number of bytes to read
  @return The integer value read