public Object readObject() throws ClassNotFoundException, IOException {
int objectSize = in.readInt();
if (objectSize <= 0) {
throw new StreamCorruptedException("Invalid objectSize: " + objectSize);
}
if (objectSize > maxObjectSize) {
throw new StreamCorruptedException("ObjectSize too big: " + objectSize + " (expected: <= " + maxObjectSize
+ ')');
}
IoBuffer buf = IoBuffer.allocate(objectSize + 4, false);
buf.putInt(objectSize);
in.readFully(buf.array(), 4, objectSize);
buf.position(0);
buf.limit(objectSize + 4);
return buf.getObject(classLoader);
}
ObjectSerializationInputStream.java 文件源码
java
阅读 30
收藏 0
点赞 0
评论 0
项目:neoscada
作者:
评论列表
文章目录