title: Java, convert Byte Array to HashMap or JSON string
body: <p>I'm making an Android App to manage a Unix computer remotely. The application also allows you to see real-time PC statistics (CPU temperature, CPU load, etc.). On the pc there is a Python server that through a socket sends a JSON string as a byte array to the app which contains the PC statistics, like this:</p>
  <pre><code>[123, 45, 67, 90, ...]
  </code></pre>
  <p>This is the contents of the byte array (I decoded it with a website):</p>
  <pre class="lang-json prettyprint-override"><code>{
      &quot;author&quot;: &quot;Anton&quot;,
      &quot;type&quot;: &quot;server info&quot;,
      &quot;date&quot;: &quot;08/01/2021&quot;,
      &quot;content&quot;: &quot;&quot;,
      &quot;opt&quot;: {
          &quot;cpu&quot;: {
              &quot;freq&quot;: [3866.041875, 1600.0, 3900.0],
              &quot;usage&quot;: [0.0, 0.0, 1.0, 2.0, 1.0, 1.0, 0.0, 2.0],
              &quot;load&quot;: [0.5, 0.63, 0.61]
          },
          &quot;memory&quot;: {
              &quot;ram&quot;: [15.54, 12.01, 22.7, 2.85, 9.67]
          },
          &quot;disks&quot;: {
              &quot;ssd&quot;: [219.1, 13.0, 194.9, 6.3],
              &quot;hdd&quot;: [0.0, 0.0, 0, 100.0]
          },
          &quot;temps&quot;: {
              &quot;core-0&quot;: [32.0, 85.0, 105.0],
              &quot;core-1&quot;: [36.0, 85.0, 105.0],
              &quot;core-2&quot;: [37.0, 85.0, 105.0],
              &quot;core-3&quot;: [38.0, 85.0, 105.0]
          }
      },
      &quot;attached&quot;: null
  }
  </code></pre>
  <p>How can I transform the byte array into a structure like a <code>HashMap</code> or a JSON string, so that I can retrieve the PC statistics, and then view them in the App through ProgressiveBars?</p>