更新Convert的Array、Map相关接口

This commit is contained in:
Redkale
2018-07-19 10:26:40 +08:00
parent 8d2f2a28af
commit 03e9a5cbcb
25 changed files with 223 additions and 60 deletions

View File

@@ -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 {