How do I write pretty print JSON filter with Jackson?

byte [] bytes = ...;
ObjectMapper mapper = new ObjectMapper();
mapper.enable(SerializationFeature.INDENT_OUTPUT);
JsonNode tree = mapper.readTree(bytes);
bytes = mapper.writeValueAsBytes(tree);

This code works well.

Published: 2014-11-28(Fri) 08:09