title: Pretty print Jackson json without whitespaces?
body: <p>I have a <code>json</code> string that I want to pretty print with <code>jackson</code>. The following works in general:</p>
  
  <pre><code>    ObjectWriter w = new ObjectMapper()
              .writer()
              .withDefaultPrettyPrinter();
  
      Object obj = new ObjectMapper().readValue(json, Object.class);
      System.out.println(w.writeValueAsString(obj));
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>{
     "myarray" : [ {
        "field" : "val"
     } ]
  }
  </code></pre>
  
  <p>BUT: I'd like to get the output without whitespaces between parameters. Is  that possible?</p>
  
  <p>Desired output:</p>
  
  <pre><code>{
     "myarray":[{
        "field":"val"
     }]
  }
  </code></pre>