title: How do I convert an InputStream into a Map in Groovy?
body: <p>Suppose I have an <strong>InputStream</strong> that contains JSON data, and I want to convert it to a Map(Key Value Pairs), so for example I can write that to a log file.</p>
  
  <p>What is the easiest way to take the InputStream and convert it to a Map?</p>
  
  <pre><code>public String convertInputStreamToMap(InputStream isobj) {
      // ???
  }
  </code></pre>
  
  <p>I've tried converting to <strong>String</strong> which works as expected but when the data is really long the data will be incomplete. So I want some easiest way to directly convert this to Map.</p>