修复json在ByteBuffer、InputSteam参数下无法解决数组的问题
This commit is contained in:
@@ -132,6 +132,7 @@ public class JsonByteBufferReader extends JsonReader {
|
||||
if (ch == 'N' && nextChar() == 'U' && nextChar() == 'L' && nextChar() == 'L') {
|
||||
return null;
|
||||
}
|
||||
int pos = this.position;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(ch);
|
||||
char one;
|
||||
@@ -139,7 +140,7 @@ public class JsonByteBufferReader extends JsonReader {
|
||||
while ((one = nextChar()) != 0) sb.append(one);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
throw new ConvertException("a json object text must begin with '{' (position = " + position + ") but '" + ch + "' in (" + sb + ")");
|
||||
throw new ConvertException("a json object text must begin with '{' (position = " + pos + ") but '" + ch + "' in (" + sb + ")");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -365,13 +365,13 @@ public class JsonReader extends Reader {
|
||||
if (nt == '}' || nt == ']') {
|
||||
return false;
|
||||
}
|
||||
this.position--;
|
||||
backChar(ch);
|
||||
return true;
|
||||
}
|
||||
if (ch == '}' || ch == ']') {
|
||||
return false;
|
||||
}
|
||||
this.position--; // { [ 交由 readObjectB 或 readMapB 或 readArrayB 读取
|
||||
backChar(ch); // { [ 交由 readObjectB 或 readMapB 或 readArrayB 读取
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user