/**
* De-serializes a byte array in the context of a classloader.
*
* @param loader the classloader to use for de-serialization
* @param data The byte array to be de-sererialized.
*
* @return The de-serialized object stream.
*
* @exception OperationsException Any of the usual Input/Output related
* exceptions.
*/
public ObjectInputStream deserialize(ClassLoader loader, byte[] data)
throws OperationsException {
// Check parameter validity
if (data == null) {
throw new RuntimeOperationsException(new
IllegalArgumentException(), "Null data passed in parameter");
}
if (data.length == 0) {
throw new RuntimeOperationsException(new
IllegalArgumentException(), "Empty data passed in parameter");
}
// Object deserialization
ByteArrayInputStream bIn;
ObjectInputStream objIn;
bIn = new ByteArrayInputStream(data);
try {
objIn = new ObjectInputStreamWithLoader(bIn,loader);
} catch (IOException e) {
throw new OperationsException(
"An IOException occurred trying to de-serialize the data");
}
return objIn;
}
MBeanInstantiator.java 文件源码
java
阅读 22
收藏 0
点赞 0
评论 0
项目:openjdk9
作者:
评论列表
文章目录