更新Convert的Array、Map相关接口
This commit is contained in:
@@ -62,8 +62,13 @@ public final class ArrayDecoder<T> implements Decodeable<Reader, T[]> {
|
||||
|
||||
@Override
|
||||
public T[] convertFrom(Reader in) {
|
||||
final int len = in.readArrayB();
|
||||
int len = in.readArrayB();
|
||||
int contentLength = -1;
|
||||
if (len == Reader.SIGN_NULL) return null;
|
||||
if (len == Reader.SIGN_NOLENBUTBYTES) {
|
||||
contentLength = in.readMemberContentLength();
|
||||
len = Reader.SIGN_NOLENGTH;
|
||||
}
|
||||
if (this.decoder == null) {
|
||||
if (!this.inited) {
|
||||
synchronized (lock) {
|
||||
@@ -78,7 +83,8 @@ public final class ArrayDecoder<T> implements Decodeable<Reader, T[]> {
|
||||
final Decodeable<Reader, T> localdecoder = this.decoder;
|
||||
final List<T> result = new ArrayList();
|
||||
if (len == Reader.SIGN_NOLENGTH) {
|
||||
while (in.hasNext()) {
|
||||
int startPosition = in.position();
|
||||
while (in.hasNext(startPosition, contentLength)) {
|
||||
result.add(localdecoder.convertFrom(in));
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user