diff --git a/ast/src/main/java/net/hamnaberg/json/PrettyPrinter.java b/ast/src/main/java/net/hamnaberg/json/PrettyPrinter.java index 246b9db..2bd6709 100644 --- a/ast/src/main/java/net/hamnaberg/json/PrettyPrinter.java +++ b/ast/src/main/java/net/hamnaberg/json/PrettyPrinter.java @@ -2,6 +2,7 @@ import java.io.IOException; +import java.nio.CharBuffer; import java.util.Map; public final class PrettyPrinter { @@ -91,7 +92,7 @@ PrinterState append(String s) { void append(char[] chars, int i, int length) { try { - appendable.append(new String(chars), i, length); + appendable.append(CharBuffer.wrap(chars), i, length); } catch (IOException e) { throw new JsonWriteException("Unable to append to writer", e); }