use of org.mule.runtime.module.artifact.api.serializer.ArtifactClassLoaderObjectInputStream in project mule by mulesoft.
the class CustomJavaSerializationProtocol method doDeserialize.
/**
* {@inheritDoc}
*/
@Override
protected <T> T doDeserialize(InputStream inputStream, ClassLoader classLoader) throws Exception {
checkArgument(inputStream != null, "Cannot deserialize a null stream");
checkArgument(classLoader != null, "Cannot deserialize with a null classloader");
try (ObjectInputStream in = new ArtifactClassLoaderObjectInputStream(classLoaderRepository, inputStream)) {
Object obj = in.readObject();
return (T) obj;
} catch (Exception ex) {
throw new SerializationException("Cannot deserialize object", ex);
}
}
Aggregations