Skip to content

Commit

Permalink
use CharBuffer instead of String
Browse files Browse the repository at this point in the history
  • Loading branch information
hamnis committed Sep 13, 2024
1 parent 775a840 commit 3783f3c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ast/src/main/java/net/hamnaberg/json/PrettyPrinter.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@


import java.io.IOException;
import java.nio.CharBuffer;
import java.util.Map;

public final class PrettyPrinter {
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 3783f3c

Please sign in to comment.