Prettyprint for encoder, exchanged StringBuilder for Writer