This commit is contained in:
Redkale
2018-01-10 10:22:46 +08:00
parent bcefaee3e9
commit 7d3e4529af

View File

@@ -155,7 +155,7 @@ public class JsonByteBufferWriter extends JsonWriter {
if (charset == null) { //UTF-8
final int limit = start + len;
for (int i = start; i < limit; i++) {
buffer = putChar(buffer, chs[i]);
buffer = putUTF8Char(buffer, chs[i]);
}
} else {
while (bb.hasRemaining()) {
@@ -169,7 +169,7 @@ public class JsonByteBufferWriter extends JsonWriter {
}
}
private ByteBuffer putChar(ByteBuffer buffer, char c) {
private ByteBuffer putUTF8Char(ByteBuffer buffer, char c) {
if (c < 0x80) {
if (!buffer.hasRemaining()) buffer = nextByteBuffer();
buffer.put((byte) c);