sharing classResolver cache across all CompactObjectInputStream's in the same way, as we did in ObjectDecoder
This commit is contained in:
parent
deb61aa021
commit
99e9da1e75
@ -35,8 +35,8 @@ public class ObjectDecoderInputStream extends InputStream implements
|
||||
ObjectInput {
|
||||
|
||||
private final DataInputStream in;
|
||||
private final ClassLoader classLoader;
|
||||
private final int maxObjectSize;
|
||||
private final ClassResolver classResolver;
|
||||
|
||||
/**
|
||||
* Creates a new {@link ObjectInput}.
|
||||
@ -104,7 +104,7 @@ public class ObjectDecoderInputStream extends InputStream implements
|
||||
} else {
|
||||
this.in = new DataInputStream(in);
|
||||
}
|
||||
this.classLoader = classLoader;
|
||||
this.classResolver = ClassResolvers.cachingResolver(classLoader);
|
||||
this.maxObjectSize = maxObjectSize;
|
||||
}
|
||||
|
||||
@ -119,7 +119,7 @@ public class ObjectDecoderInputStream extends InputStream implements
|
||||
"data length too big: " + dataLen + " (max: " + maxObjectSize + ')');
|
||||
}
|
||||
|
||||
return new CompactObjectInputStream(in, ClassResolvers.cachingResolver(classLoader)).readObject();
|
||||
return new CompactObjectInputStream(in, classResolver).readObject();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user